Skip to content

Instantly share code, notes, and snippets.

@andrejewski
Created May 3, 2017 17:08
Show Gist options
  • Select an option

  • Save andrejewski/9c604c2ed8d5b6b1b8df5bfdd35abcf7 to your computer and use it in GitHub Desktop.

Select an option

Save andrejewski/9c604c2ed8d5b6b1b8df5bfdd35abcf7 to your computer and use it in GitHub Desktop.
Landscaper test mods
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