diff options
Diffstat (limited to 'baserockimport/exts/npm.to_lorry')
-rwxr-xr-x | baserockimport/exts/npm.to_lorry | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/baserockimport/exts/npm.to_lorry b/baserockimport/exts/npm.to_lorry index ba0f442..65d8712 100755 --- a/baserockimport/exts/npm.to_lorry +++ b/baserockimport/exts/npm.to_lorry @@ -20,11 +20,13 @@ npm = require("npm"); base = require("./importer_base"); npm.load(function(er, npm) { - if (process.argv.length === 3) - packageName = process.argv[2]; - else - throw ("Error! Too many command line arguments! Usage: " + - "./npm.to_lorry PACKAGENAME"); + + if (! (process.argv.length == 3 || process.argv.length == 4)) { + throw ("Usage: ./npm.to_lorry PACKAGENAME [VERSION]"); + } + + packageName = process.argv[2]; + if (er) throw er; npm.commands.view([packageName], "silent", getRepo); |