From 9e464b41e3255c95b6d72b8eb5f682c44171a536 Mon Sep 17 00:00:00 2001 From: Richard Ipsum Date: Fri, 9 Jan 2015 18:17:25 +0000 Subject: Make npm lorry ext work with new interface --- baserockimport/exts/npm.to_lorry | 12 +++++++----- 1 file 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); -- cgit v1.2.1