Skip to content

Commit

Permalink
Merge pull request #2 from jesusprubio/master
Browse files Browse the repository at this point in the history
Avoiding a break if the script field not present.
  • Loading branch information
contolini committed Apr 27, 2016
2 parents 2f04ab2 + a31b60a commit b181094
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Expand Up @@ -25,6 +25,8 @@ function processModule(module) {
var contents;
if (!err) {
contents = JSON.parse(fs.readFileSync(manifest));
// To avoid a break if the script field not present.
if (!contents.scripts) { contents.scripts = {}; }
contents.scripts.install = script;
fs.writeFile(manifest, JSON.stringify(contents, null, 4), function(err) {
if (!err) publishModule(module);
Expand Down

0 comments on commit b181094

Please sign in to comment.