Skip to content

Commit

Permalink
Merge branch 'master' of github.com:peerigon/updtr
Browse files Browse the repository at this point in the history
  • Loading branch information
matthaias committed Mar 20, 2016
2 parents cb4ec49 + a3fb3fb commit cf8cd11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ npm install -g updtr
-t, --test <test> change the command for the tests
-e, --exclude <exclude> exclude modules comma seperated, e.g. updtr --exclude module1,module2
--test-stdout shows stdout if your test command fails
--save-exact save exact module version
```

## License
Expand Down
6 changes: 4 additions & 2 deletions bin/updtr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ program
.option("-w, --wanted", "updates to wanted version specified in package.json instead of the modules latest version")
.option("-t, --test <test>", "change the command for the tests")
.option("-e, --exclude <exclude>", "exclude modules comma seperated, e.g. updtr --exclude module1,module2", "excludes")
.option("--test-stdout", "shows stdout if your test command fails");
.option("--test-stdout", "shows stdout if your test command fails")
.option("--save-exact", "save exact module version");

program.parse(process.argv);

Expand All @@ -28,7 +29,8 @@ updtr.run({
wanted: program.wanted,
testCmd: program.test,
exclude: program.exclude,
testStdout: program.testStdout
testStdout: program.testStdout,
saveExact: program.saveExact
}, function (err) {
if (err) {
throw err;
Expand Down
7 changes: 6 additions & 1 deletion lib/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,17 @@ function run(config, done) {
testCmd: testCmd
};
var testStdout;
var installCmd = "npm i " + info.name + "@" + info.updateTo + " " + info.saveCmd;

if (config.saveExact) {
installCmd += " --save-exact";
}

emitter.emit("updating", event);

async.series({
deleteOldVersion: async.apply(exec, "npm remove " + info.name + " " + info.saveCmd),
installNewVersion: async.apply(exec, "npm i " + info.name + "@" + info.updateTo + " " + info.saveCmd),
installNewVersion: async.apply(exec, installCmd),
emitTestingEvent: function (done) {
emitter.emit("testing", event);
setImmediate(done);
Expand Down

0 comments on commit cf8cd11

Please sign in to comment.