Created
May 3, 2017 17:08
-
-
Save andrejewski/9c604c2ed8d5b6b1b8df5bfdd35abcf7 to your computer and use it in GitHub Desktop.
Landscaper test mods
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs') | |
| var path = require('path') | |
| module.exports = { | |
| getOptions: function () { | |
| return [{ | |
| name: 'content', | |
| type: 'input', | |
| default: 'Some text I made', | |
| message: 'Text to write' | |
| }] | |
| }, | |
| run: function (directory, options) { | |
| var text = options.content | |
| var filepath = path.join(directory, 'foo.txt') | |
| return new Promise(function (resolve, reject) { | |
| fs.writeFile(filepath, text, function (error) { | |
| error ? reject(error) : resolve() | |
| }) | |
| }) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment