From 1caeb96d87669cdc86936b51244f32560ce99108 Mon Sep 17 00:00:00 2001 From: Matthew Arbesfeld Date: Tue, 12 Aug 2014 14:27:16 -0700 Subject: [PATCH] Rename to --- tools/commands.js | 52 ++++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/tools/commands.js b/tools/commands.js index 9a967bcc60..274acac772 100644 --- a/tools/commands.js +++ b/tools/commands.js @@ -539,26 +539,10 @@ main.registerCommand({ }); /////////////////////////////////////////////////////////////////////////////// -// bundle +// build /////////////////////////////////////////////////////////////////////////////// -main.registerCommand({ - name: 'bundle', - minArgs: 1, - maxArgs: 1, - requiresApp: true, - options: { - debug: { type: Boolean }, - directory: { type: Boolean }, - architecture: { type: String }, - // Undocumented - 'for-deploy': { type: Boolean }, - port: { type: String, short: "p", default: "localhost:3000" }, - settings: { type: String}, // XXX document - 'ios-path': { type: String }, - 'android-path': { type: String }, - } -}, function (options) { +var buildWithOptions = function (options) { // XXX if they pass a file that doesn't end in .tar.gz or .tgz, add // the former for them @@ -659,7 +643,37 @@ main.registerCommand({ } } files.rm_recursive(buildDir); -}); +}; + +var buildCommands = { + minArgs: 1, + maxArgs: 1, + requiresApp: true, + options: { + debug: { type: Boolean }, + directory: { type: Boolean }, + architecture: { type: String }, + // Undocumented + 'for-deploy': { type: Boolean }, + port: { type: String, short: "p", default: "localhost:3000" }, + settings: { type: String}, // XXX document + 'ios-path': { type: String }, + 'android-path': { type: String }, + } +}; + +main.registerCommand(_.extend({ name: 'build'}, buildCommands), + function (options) { + buildWithOptions(options); + }); + +// Deprecated -- identical functionality to 'build' +main.registerCommand(_.extend({ name: 'bundle'}, buildCommands), + function (options) { + process.stdout.write("WARNING: 'bundle' has been deprecated. " + + "Use 'build' instead.\n"); + buildWithOptions(options); + }); /////////////////////////////////////////////////////////////////////////////// // mongo