Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions packages/angular-cli/commands/init.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,7 +18,6 @@ const InitCommand: any = Command.extend({
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: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
Expand All@@ -34,10 +33,6 @@ const InitCommand: any = Command.extend({

anonymousOptions: ['<glob-pattern>'],

_defaultBlueprint: function () {
return 'ng2';
},

run: function (commandOptions: any, rawArgs: string[]) {
if (commandOptions.dryRun) {
commandOptions.skipNpm = true;
Expand DownExpand Up@@ -100,7 +95,7 @@ const InitCommand: any = Command.extend({

const blueprintOpts = {
dryRun: commandOptions.dryRun,
blueprint: commandOptions.blueprint || this._defaultBlueprint(),
blueprint: 'ng2',
rawName: packageName,
targetFiles: rawArgs || '',
rawArgs: rawArgs.toString(),
Expand Down
7 changes: 2 additions & 5 deletions packages/angular-cli/commands/new.ts
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
import * as chalk from 'chalk';
import InitCommand from './init';

const Command = require('ember-cli/lib/models/command');
const Project = require('ember-cli/lib/models/project');
const SilentError = require('silent-error');
const validProjectName = require('ember-cli/lib/utilities/valid-project-name');

const normalizeBlueprint = require('ember-cli/lib/utilities/normalize-blueprint-option');
import InitCommand from './init';

const NewCommand = Command.extend({
name: 'new',
Expand All@@ -15,7 +15,6 @@ const NewCommand = Command.extend({
availableOptions: [
{ name: 'dry-run', type: Boolean, default: false, aliases: ['d'] },
{ name: 'verbose', type: Boolean, default: false, aliases: ['v'] },
{ name: 'blueprint', type: String, default: 'ng2', aliases: ['b'] },
{ name: 'link-cli', type: Boolean, default: false, aliases: ['lc'] },
{ name: 'skip-npm', type: Boolean, default: false, aliases: ['sn'] },
{ name: 'skip-bower', type: Boolean, default: true, aliases: ['sb'] },
Expand DownExpand Up@@ -62,8 +61,6 @@ const NewCommand = Command.extend({
));
}

commandOptions.blueprint = normalizeBlueprint(commandOptions.blueprint);

if (!commandOptions.directory) {
commandOptions.directory = packageName;
}
Expand Down
36 changes: 0 additions & 36 deletions tests/acceptance/new.spec.js
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,42 +103,6 @@ describe('Acceptance: ng new', function () {
.then(confirmBlueprinted);
});

it('ng new with blueprint uses the specified blueprint directory with a relative path',
function () {
return tmp.setup('./tmp/my_blueprint')
.then(function () {
return tmp.setup('./tmp/my_blueprint/files');
})
.then(function () {
fs.writeFileSync('./tmp/my_blueprint/files/gitignore');
process.chdir('./tmp');

return ng([
'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git',
'--blueprint=./my_blueprint'
]);
})
.then(confirmBlueprintedForDir('tmp/my_blueprint'));
});

it('ng new with blueprint uses the specified blueprint directory with an absolute path',
function () {
return tmp.setup('./tmp/my_blueprint')
.then(function () {
return tmp.setup('./tmp/my_blueprint/files');
})
.then(function () {
fs.writeFileSync('./tmp/my_blueprint/files/gitignore');
process.chdir('./tmp');

return ng([
'new', 'foo', '--skip-npm', '--skip-bower', '--skip-git',
'--blueprint=' + path.resolve(process.cwd(), './my_blueprint')
]);
})
.then(confirmBlueprintedForDir('tmp/my_blueprint'));
});

it('ng new without skip-git flag creates .git dir', function () {
return ng(['new', 'foo', '--skip-npm', '--skip-bower']).then(function () {
expect(existsSync('.git'));
Expand Down