Skip to content

Commit

Permalink
Implement npm command
Browse files Browse the repository at this point in the history
I think that makes parity with the official CLI
  • Loading branch information
agnoster committed Feb 1, 2011
1 parent 287a483 commit cdb01e3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion bin/nodester.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,23 @@ var commands = {
}.bind(this))
}.bind(this))
}
, npm: notimplemented
, npm: function(args, options) {
this.config.vars(['base', 'user', 'pass', 'app'], function(err, conf) {
var action = args.shift()
, package = args.shift()
, n = new Nodester(conf.user, conf.pass, conf.base)
this.spinner("# " + action + " " + package + "... ")
n.appnpm_handler(conf.app, package, action, function(err, data) {
if (err) {
this.spinner("# " + action + " " + package + "... failed\n", true)
this.fatal(err.message)
}
this.spinner("# " + action + " " + package + "... done\n", true)
this.ok('success')
console.log(data.output)
}.bind(this))
}.bind(this))
}
}

var require_password = function(config, mustConfirm, cb) {
Expand Down

0 comments on commit cdb01e3

Please sign in to comment.