Created
November 23, 2015 18:43
-
-
Save jon49/32dbe0fae971c3e7d39b to your computer and use it in GitHub Desktop.
Revisions
-
jon49 created this gist
Nov 23, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ import r = require('ramda') import yaml = require('js-yaml') import {readFile, writeFile} from 'fs' var package = require('../package.json') readFile('../scripts.yml', 'utf-8', (err, file) => { if (err) { console.log('Error reading scripts.yml', err) return process.exit(1) } const scripts = yaml.load(file), combined = r.merge(package, scripts) writeFile('./package.json', JSON.stringify(combined, null, ' ').replace(/\\n/g, ' '), err => { if (err) { console.error('There was an error writing to package.json!', err) return process.exit(1) } process.exit(0) }) })