Skip to content

Commit

Permalink
cleanup whitespace in the commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Sep 10, 2015
1 parent 5e5d767 commit fbf8cb8
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 110 deletions.
12 changes: 6 additions & 6 deletions lib/commands/addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module.exports = NewCommand.extend({
description: 'Generates a new folder structure for building an addon, complete with test harness.',

availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, default: 'addon', aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] },
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, default: 'addon', aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] },
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
],

anonymousOptions: [
Expand Down
8 changes: 4 additions & 4 deletions lib/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ module.exports = Command.extend({
aliases: ['b'],

availableOptions: [
{ name: 'environment', type: String, default: 'development', aliases: ['e',{'dev' : 'development'}, {'prod' : 'production'}] },
{ name: 'output-path', type: path, default: 'dist/', aliases: ['o'] },
{ name: 'watch', type: Boolean, default: false, aliases: ['w'] },
{ name: 'watcher', type: String }
{ name: 'environment', type: String, default: 'development', aliases: ['e', { 'dev': 'development' }, { 'prod': 'production' }] },
{ name: 'output-path', type: path, default: 'dist/', aliases: ['o'] },
{ name: 'watch', type: Boolean, default: false, aliases: ['w'] },
{ name: 'watcher', type: String }
],

run: function(commandOptions) {
Expand Down
26 changes: 12 additions & 14 deletions lib/commands/destroy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
'use strict';

var Command = require('../models/command');
var Promise = require('../ext/promise');
var Blueprint = require('../models/blueprint');
var merge = require('lodash/object/merge');

var Command = require('../models/command');
var Promise = require('../ext/promise');
var Blueprint = require('../models/blueprint');
var merge = require('lodash/object/merge');
var SilentError = require('silent-error');

module.exports = Command.extend({
Expand All @@ -14,13 +13,12 @@ module.exports = Command.extend({
works: 'insideProject',

availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'pod', type: Boolean, default: false, aliases: ['p'] },
{ name: 'classic', type: Boolean, default: false, aliases: ['c'] },
{ name: 'dummy', type: Boolean, default: false, aliases: ['dum','id'] },
{ name: 'in-repo-addon', type: String, default: null, aliases: ['in-repo', 'ir'] }

{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'pod', type: Boolean, default: false, aliases: ['p'] },
{ name: 'classic', type: Boolean, default: false, aliases: ['c'] },
{ name: 'dummy', type: Boolean, default: false, aliases: ['dum', 'id'] },
{ name: 'in-repo-addon', type: String, default: null, aliases: ['in-repo', 'ir'] }
],

anonymousOptions: [
Expand All @@ -32,7 +30,7 @@ module.exports = Command.extend({
return;
}
try {
// merge in blueprint availableOptions
// merge in blueprint availableOptions
this.registerOptions(this.lookupBlueprint(rawArgs[0]));
} catch(e) {
SilentError.debugOrThrow('ember-cli/commands/destroy', e);
Expand Down Expand Up @@ -67,7 +65,7 @@ module.exports = Command.extend({
args: rawArgs
};

if(this.settings && this.settings.usePods && !commandOptions.classic) {
if (this.settings && this.settings.usePods && !commandOptions.classic) {
commandOptions.pod = !commandOptions.pod;
}

Expand Down
32 changes: 15 additions & 17 deletions lib/commands/generate.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
'use strict';

var chalk = require('chalk');
var Command = require('../models/command');
var Promise = require('../ext/promise');
var Blueprint = require('../models/blueprint');
var merge = require('lodash/object/merge');
var reject = require('lodash/collection/reject');
var EOL = require('os').EOL;

var chalk = require('chalk');
var Command = require('../models/command');
var Promise = require('../ext/promise');
var Blueprint = require('../models/blueprint');
var merge = require('lodash/object/merge');
var reject = require('lodash/collection/reject');
var EOL = require('os').EOL;
var SilentError = require('silent-error');

module.exports = Command.extend({
Expand All @@ -17,27 +16,27 @@ module.exports = Command.extend({
works: 'insideProject',

availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'pod', type: Boolean, default: false, aliases: ['p'] },
{ name: 'classic', type: Boolean, default: false, aliases: ['c'] },
{ name: 'dummy', type: Boolean, default: false, aliases: ['dum','id'] },
{ name: 'in-repo-addon', type: String, default: null, aliases: ['in-repo', 'ir'] }
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'pod', type: Boolean, default: false, aliases: ['p'] },
{ name: 'classic', type: Boolean, default: false, aliases: ['c'] },
{ name: 'dummy', type: Boolean, default: false, aliases: ['dum', 'id'] },
{ name: 'in-repo-addon', type: String, default: null, aliases: ['in-repo', 'ir'] }
],

anonymousOptions: [
'<blueprint>'
],

beforeRun: function(rawArgs){
beforeRun: function(rawArgs) {
if (!rawArgs.length) {
return;
}
// merge in blueprint availableOptions
var blueprint;
try{
blueprint = this.lookupBlueprint(rawArgs[0]);
this.registerOptions( blueprint );
this.registerOptions(blueprint);
}
catch(e) {
SilentError.debugOrThrow('ember-cli/commands/generate', e);
Expand Down Expand Up @@ -133,7 +132,6 @@ module.exports = Command.extend({
},

getPackageBlueprints: function(collection, options, singleBlueprintName) {

var verbose = options.verbose;
var blueprints = collection.blueprints;

Expand Down
12 changes: 4 additions & 8 deletions lib/commands/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,28 @@ var RootCommand = Command.extend({
isRoot: true,
name: 'ember',

availableOptions: [],

anonymousOptions: [
'<command (Default: help)>'
]
});

module.exports = Command.extend({
name: 'help',
works: 'everywhere',
description: 'Outputs the usage instructions for all commands or the provided command',
aliases: [undefined, 'h', '--help', '-h'],
works: 'everywhere',

availableOptions: [
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'json', type: Boolean, default: false }
{ name: 'json', type: Boolean, default: false }
],

anonymousOptions: [
'<command-name (Default: all)>'
],

run: function(commandOptions, rawArgs) {
var multipleCommands = ['g','generate'];
var multipleCommands = ['g', 'generate'];
var command;
var json;
var rootCommand = new RootCommand({
Expand Down Expand Up @@ -99,7 +97,7 @@ module.exports = Command.extend({
}.bind(this));
}

if(multipleCommands.indexOf(rawArgs[0]) > -1) {
if (multipleCommands.indexOf(rawArgs[0]) > -1) {
command = rawArgs.shift();
if (rawArgs.length > 0) {
commandOptions.rawArgs = rawArgs;
Expand All @@ -109,9 +107,7 @@ module.exports = Command.extend({
} else {
this._printDetailedHelpForCommand(command, commandOptions);
}

} else {

// Iterate through each arg beyond the initial 'help' command,
// and try to display usage instructions.
rawArgs.forEach(function(commandName) {
Expand Down
21 changes: 10 additions & 11 deletions lib/commands/init.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
'use strict';

var Command = require('../models/command');
var Promise = require('../ext/promise');

var Command = require('../models/command');
var Promise = require('../ext/promise');
var SilentError = require('silent-error');
var validProjectName = require('../utilities/valid-project-name');
var normalizeBlueprint = require('../utilities/normalize-blueprint-option');
var debug = require('debug')('ember-cli:command:init');

module.exports = Command.extend({
name: 'init',
aliases: ['i'],
description: 'Creates a new ember-cli project in the current folder.',
aliases: ['i'],
works: 'everywhere',

availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] },
{ name: 'name', type: String, default: '', aliases: ['n'] }
{ name: 'name', type: String, default: '', aliases: ['n'] }
],

anonymousOptions: [
Expand Down Expand Up @@ -63,8 +62,8 @@ module.exports = Command.extend({
});
}

var project = this.project;
var packageName = commandOptions.name !== '.' && commandOptions.name || project.name();
var project = this.project;
var packageName = commandOptions.name !== '.' && commandOptions.name || project.name();

if (!packageName) {
var message = 'The `ember ' + this.name + '` command requires a ' +
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/install-bower.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var Command = require('../models/command');
var Command = require('../models/command');
var SilentError = require('silent-error');
var Promise = require('../ext/promise');

Expand Down
14 changes: 7 additions & 7 deletions lib/commands/install.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

var Command = require('../models/command');
var Command = require('../models/command');
var SilentError = require('silent-error');
var Promise = require('../ext/promise');
var Promise = require('../ext/promise');

module.exports = Command.extend({
name: 'install',
Expand All @@ -23,11 +23,11 @@ module.exports = Command.extend({

var AddonInstallTask = this.tasks.AddonInstall;
var addonInstall = new AddonInstallTask({
ui: this.ui,
analytics: this.analytics,
project: this.project,
NpmInstallTask: this.tasks.NpmInstall,
BlueprintTask: this.tasks.GenerateFromBlueprint
ui: this.ui,
analytics: this.analytics,
project: this.project,
NpmInstallTask: this.tasks.NpmInstall,
BlueprintTask: this.tasks.GenerateFromBlueprint
});

return addonInstall.run({
Expand Down
24 changes: 12 additions & 12 deletions lib/commands/new.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

var chalk = require('chalk');
var Command = require('../models/command');
var Promise = require('../ext/promise');
var Project = require('../models/project');
var chalk = require('chalk');
var Command = require('../models/command');
var Promise = require('../ext/promise');
var Project = require('../models/project');
var SilentError = require('silent-error');
var validProjectName = require('../utilities/valid-project-name');
var normalizeBlueprint = require('../utilities/normalize-blueprint-option');
Expand All @@ -14,13 +14,13 @@ module.exports = Command.extend({
works: 'outsideProject',

availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, default: 'app', aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, default: 'app', aliases: ['b'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: false, aliases: ['sb'] },
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
{ name: 'directory', type: String , aliases: ['dir'] }
{ name: 'skip-git', type: Boolean, default: false, aliases: ['sg'] },
{ name: 'directory', type: String , aliases: ['dir'] }
],

anonymousOptions: [
Expand All @@ -40,7 +40,7 @@ module.exports = Command.extend({
return Promise.reject(new SilentError(message));
}

if (commandOptions.dryRun){
if (commandOptions.dryRun) {
commandOptions.skipGit = true;
}

Expand All @@ -62,7 +62,7 @@ module.exports = Command.extend({
commandOptions.directory = packageName;
}

var createAndStepIntoDirectory = new this.tasks.CreateAndStepIntoDirectory({
var createAndStepIntoDirectory = new this.tasks.CreateAndStepIntoDirectory({
ui: this.ui,
analytics: this.analytics
});
Expand Down
26 changes: 13 additions & 13 deletions lib/commands/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ module.exports = Command.extend({
aliases: ['server', 's'],

availableOptions: [
{ name: 'port', type: Number, default: process.env.PORT || 4200, aliases: ['p'] },
{ name: 'host', type: String, description: 'Listens on all interfaces by default', aliases: ['H'] },
{ name: 'proxy', type: String, aliases: ['pr','pxy'] },
{ name: 'insecure-proxy', type: Boolean, default: false, description: 'Set false to proxy self-signed SSL certificates', aliases: ['inspr'] },
{ name: 'watcher', type: String, default: 'events', aliases: ['w'] },
{ name: 'live-reload', type: Boolean, default: true, aliases: ['lr'] },
{ name: 'live-reload-host', type: String, description: 'Defaults to host', aliases: ['lrh'] },
{ name: 'live-reload-port', type: Number, description: '(Defaults to port number within [49152...65535] )', aliases: ['lrp']},
{ name: 'environment', type: String, default: 'development', aliases: ['e', {'dev' : 'development'}, {'prod' : 'production'}] },
{ name: 'output-path', type: path, default: 'dist/', aliases: ['op', 'out'] },
{ name: 'ssl', type: Boolean, default: false },
{ name: 'ssl-key', type: String, default: 'ssl/server.key' },
{ name: 'ssl-cert', type: String, default: 'ssl/server.crt' }
{ name: 'port', type: Number, default: process.env.PORT || 4200, aliases: ['p'] },
{ name: 'host', type: String, description: 'Listens on all interfaces by default', aliases: ['H'] },
{ name: 'proxy', type: String, aliases: ['pr', 'pxy'] },
{ name: 'insecure-proxy', type: Boolean, default: false, description: 'Set false to proxy self-signed SSL certificates', aliases: ['inspr'] },
{ name: 'watcher', type: String, default: 'events', aliases: ['w'] },
{ name: 'live-reload', type: Boolean, default: true, aliases: ['lr'] },
{ name: 'live-reload-host', type: String, description: 'Defaults to host', aliases: ['lrh'] },
{ name: 'live-reload-port', type: Number, description: '(Defaults to port number within [49152...65535])', aliases: ['lrp'] },
{ name: 'environment', type: String, default: 'development', aliases: ['e', { 'dev': 'development' }, { 'prod': 'production' }] },
{ name: 'output-path', type: path, default: 'dist/', aliases: ['op', 'out'] },
{ name: 'ssl', type: Boolean, default: false },
{ name: 'ssl-key', type: String, default: 'ssl/server.key' },
{ name: 'ssl-cert', type: String, default: 'ssl/server.crt' }
],

run: function(commandOptions) {
Expand Down
Loading

0 comments on commit fbf8cb8

Please sign in to comment.