-
-
Save hugojosefson/1424642 to your computer and use it in GitHub Desktop.
Put this in Cakefile to write out package.coffee to NPM package.json
This file contains 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
fs = require 'fs' | |
CoffeeScript = require 'coffee-script' | |
task "build:package", "Builds the package.json from its coffee source", (options) -> | |
js = CoffeeScript.compile "return #{fs.readFileSync('package.coffee', 'utf8')}" | |
json = JSON.stringify eval(js), null, 2 | |
fs.writeFileSync 'package.json', json | |
console.log('Successfully wrote out package.json') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment