From ab4455bedc3f03738d64292c8e871a642095c211 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Fri, 19 Sep 2014 16:15:03 -0700 Subject: [PATCH] update hft commands so first arg, the cmd, is removed from args._ --- cli/cmds/download-file.js | 4 ++-- cli/cmds/download.js | 2 +- cli/cmds/install.js | 2 +- cli/cmds/make-release.js | 2 +- cli/cmds/remove.js | 2 +- cli/cmds/uninstall.js | 2 +- cli/hft.js | 1 + 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cli/cmds/download-file.js b/cli/cmds/download-file.js index 1da6a4b0..fcedf853 100644 --- a/cli/cmds/download-file.js +++ b/cli/cmds/download-file.js @@ -53,8 +53,8 @@ var downloadFile = function(args) { verbose: args['verbose'], }; - var url = args._[1]; - var destPath = args._[2]; + var url = args._[0]; + var destPath = args._[1]; var log = options.verbose ? console.log.bind(console) : function() { }; var print = options.verbose ? sys.print.bind(sys) : function() { }; diff --git a/cli/cmds/download.js b/cli/cmds/download.js index cc2060f2..f0aadddc 100644 --- a/cli/cmds/download.js +++ b/cli/cmds/download.js @@ -55,7 +55,7 @@ var download = function(args) { overwrite: args['overwrite'], }; - var gameId = args._[1]; + var gameId = args._[0]; var emitter = require('../../management/download').download(gameId, args.dst, options); emitter.on('status', function(e) { diff --git a/cli/cmds/install.js b/cli/cmds/install.js index 96beccca..5ce6ac52 100644 --- a/cli/cmds/install.js +++ b/cli/cmds/install.js @@ -50,7 +50,7 @@ var install = function(args) { overwrite: args['upgrade'], }; - var srcPath = path.resolve(args._[1]); + var srcPath = path.resolve(args._[0]); if (require('../../management/install').install(srcPath, args.dst, options) === false) { reject(); diff --git a/cli/cmds/make-release.js b/cli/cmds/make-release.js index b22729af..7d16ccdb 100644 --- a/cli/cmds/make-release.js +++ b/cli/cmds/make-release.js @@ -48,7 +48,7 @@ var makeRelease = function(args) { return; } - var destPath = path.resolve(args._[1]); + var destPath = path.resolve(args._[0]); var fullPath = args.src ? path.resolve(args.src) : process.cwd(); require('../../management/make').make(fullPath, destPath, args).then(function(files) { diff --git a/cli/cmds/remove.js b/cli/cmds/remove.js index 1c25d958..5bbcf806 100644 --- a/cli/cmds/remove.js +++ b/cli/cmds/remove.js @@ -36,7 +36,7 @@ var Promise = require('promise'); var remove = function(args) { return new Promise(function(resolve, reject) { - var fullPath = args._.length > 1 ? args._[1] : process.cwd(); + var fullPath = args._.length > 0 ? args._[0] : process.cwd(); games.remove(fullPath); resolve(); }); diff --git a/cli/cmds/uninstall.js b/cli/cmds/uninstall.js index 89891aad..19fdf875 100644 --- a/cli/cmds/uninstall.js +++ b/cli/cmds/uninstall.js @@ -53,7 +53,7 @@ var uninstall = function(args) { verbose: args['verbose'], }; - var gamePathOrId = args._[1]; + var gamePathOrId = args._[0]; if (require('../../management/uninstall').uninstall(gamePathOrId, options) === false) { reject(); diff --git a/cli/hft.js b/cli/hft.js index b256d650..ec372203 100755 --- a/cli/hft.js +++ b/cli/hft.js @@ -84,6 +84,7 @@ try { utils.printUsage(globalOptions, cmdModule.usage, cmdModule.name); process.exit(1); } +args._.shift(); // remove cmd cmdModule.cmd(args).then(function() { // We have to exit explicitly because there are event listeners for folders process.exit(0);