From 1d4d5564a03db86a51bb0b53de4742d1d8d5c8af Mon Sep 17 00:00:00 2001 From: Matt Hernandez Date: Tue, 18 Aug 2015 11:30:51 -0400 Subject: [PATCH] removes `-t` and `-f` options Removed the `--type` and `--forceNpmInstall` options as they are no longer a thing. --- lib/commands/project.js | 8 +++----- lib/controllers/project.js | 19 +++++-------------- lib/routes/project.js | 10 ---------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/lib/commands/project.js b/lib/commands/project.js index 83a0c45..4b898c7 100755 --- a/lib/commands/project.js +++ b/lib/commands/project.js @@ -498,16 +498,14 @@ project.create = function (projectName, servoSize, runtime, cb) { * Deploys a project. * @param {string} projectName Name of the project to deploy. Specifying this skips prompts. * @param {string} dir The path to deploy. If not specified defaults to current directory. - * @param {string} projectType The type of application being deployed. * @param {boolean} includeModules Whether or not to include node_modules directory in upload. - * @param {boolean} forceNpmInstall Value indicating whether to force an npm install. * @param {string} registry npm registry url. * @param {boolean} meteorDebug Value indicating whether to override meteor debug mode. * @param {boolean} withTests Value indicating whether to run tests for the project on deploy. * @param {function} cb The callback. */ //----------------------------------------------------------------------------- -project.deploy = function (projectName, dir, projectType, includeModules, forceNpmInstall, registry, meteorDebug, withTests, cb) { +project.deploy = function (projectName, dir, includeModules, registry, meteorDebug, withTests, cb) { if (typeof dir !== 'string') { dir = process.cwd(); } @@ -604,7 +602,7 @@ project.deploy = function (projectName, dir, projectType, includeModules, forceN if (!selectedProject) { return fn('You must deploy to a project.'); } - projectController.deploy(selectedProject.id, dir, projectType, includeModules, forceNpmInstall, registry, meteorDebug, withTests, function (err, domain) { + projectController.deploy(selectedProject.id, dir, includeModules, registry, meteorDebug, withTests, function (err, domain) { if (!err) { modulus.io.success(selectedProject.name + ' running at ' + domain); fn(); @@ -620,7 +618,7 @@ project.deploy = function (projectName, dir, projectType, includeModules, forceN if (status === 'UPLOADING' && uploadTries < uploadTriesMax) { uploadTries++; modulus.io.error(util.format('Upload Failed. Retrying. (%s/%s)', uploadTries, uploadTriesMax)); - project.deploy(selectedProject.name, dir, projectType, includeModules, forceNpmInstall, registry, meteorDebug, fn); + project.deploy(selectedProject.name, dir, includeModules, registry, meteorDebug, fn); } else { fn(err); } diff --git a/lib/controllers/project.js b/lib/controllers/project.js index 06cac8c..52d3a07 100755 --- a/lib/controllers/project.js +++ b/lib/controllers/project.js @@ -221,21 +221,13 @@ Project.prototype.saveVars = function(projectId, vars, callback) { }; //----------------------------------------------------------------------------- -Project.prototype.deploy = function(projectId, dir, projectType, includeModules, forceNpmInstall, registry, meteorDebug, withTests, callback) { +Project.prototype.deploy = function(projectId, dir, includeModules, registry, meteorDebug, withTests, callback) { var projectController = this; + var projectType; async.waterfall([ function(cb) { - if (projectType) { - projectType = projectType.toUpperCase(); - if (Project.types.hasOwnProperty(projectType)) { - cb(null, Project.types[projectType]); - } else { - cb({code:'INVALID_PROJECT_TYPE'}); - } - } else { - projectController.detectProjectType(dir, cb); - } + projectController.detectProjectType(dir, cb); }, function(type, cb) { @@ -275,7 +267,7 @@ Project.prototype.deploy = function(projectId, dir, projectType, includeModules, }, function(path, zipFile, cb) { - projectController._deploy(projectId, zipFile, forceNpmInstall, registry, withTests, function(err, domain) { + projectController._deploy(projectId, zipFile, registry, withTests, function(err, domain) { fs.unlinkSync(zipFile); //Removes the .demeteorized folder @@ -303,7 +295,7 @@ Project.prototype.deploy = function(projectId, dir, projectType, includeModules, }; //----------------------------------------------------------------------------- -Project.prototype._deploy = function(projectId, file, forceNpmInstall, registry, withTests, callback) { +Project.prototype._deploy = function(projectId, file, registry, withTests, callback) { modulus.io.print('Uploading project...'); var status = Project.status.uploading; @@ -319,7 +311,6 @@ Project.prototype._deploy = function(projectId, file, forceNpmInstall, registry, var client = new Uploader(), options = { - forceNpmInstall: !!forceNpmInstall, registry: registry, withTests: !!withTests }; diff --git a/lib/routes/project.js b/lib/routes/project.js index d30f9c4..404c20e 100755 --- a/lib/routes/project.js +++ b/lib/routes/project.js @@ -152,11 +152,7 @@ module.exports = function (modulus) { this.line(' options:'.input); this.line(' -p, --project-name Name of the project to deploy. Prompts are skipped when specified.'.input); this.line(' -m, --include-modules Flag that indicates whether or not to include the node_modules folder in the bundle.'.input); - this.line(' -f, --force-npm-install Triggers a reinstall of node modules.'.input); this.line(' -r, --registry Specify a registry to install modules from.'.input); - this.line(' -t, --project-type Specifies type of application you are deploying. Overrides the auto-detection that occurs normally. Acceptable types are listed below.'.input); - this.line(' nodejs A typical Node.js application.'.input); - this.line(' meteor A Meteor application.'.input); this.line(' -w, --with-tests Specifies that tests should be run before deploying this project.'.input); this.line(' -D, --meteor-debug Override debug mode for meteor project.'.input); }); @@ -166,9 +162,7 @@ module.exports = function (modulus) { .option('-d, --download', 'Flag that signals to download the logs instead of printing them.') .option('-o, --output [value]', 'Specifies the file to download to. Must be file type tar.gz') .option('-m, --include-modules', 'Flag that indicates whether or not to include the node_modules folder in the bundle.') - .option('-f, --force-npm-install', 'Triggers a reinstall of node modules.') .option('-r, --registry [value]', 'Specify a registry to install modules from', '') - .option('-t, --project-type [value]', 'Specifies the type of application the project is. Ex: "node" or "meteor".') .option('-w, --with-tests', 'Specifies that tests should be run before deploying this project.') .option('-D, --meteor-debug', 'Override debug mode for meteor projects.'); @@ -182,9 +176,7 @@ module.exports = function (modulus) { [ modulus.program.projectName, dir, - modulus.program.projectType, modulus.program.includeModules, - modulus.program.forceNpmInstall, modulus.program.registry, modulus.program.meteorDebug, modulus.program.withTests @@ -202,9 +194,7 @@ module.exports = function (modulus) { [ modulus.program.projectName, dir, - modulus.program.projectType, modulus.program.includeModules, - modulus.program.forceNpmInstall, modulus.program.registry, modulus.program.meteorDebug, modulus.program.withTests