Skip to content

Commit

Permalink
fix(init): ignore favicon
Browse files Browse the repository at this point in the history
Avoid crashes when choosing to diff the favicon.ico during overwrite.

Closes #2274
Close #2617
  • Loading branch information
Puigcerber authored and filipesilva committed Oct 10, 2016
1 parent ab529b7 commit 699ebba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 6 additions & 0 deletions packages/angular-cli/blueprints/ng2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ module.exports = {
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }
],

beforeInstall: function(options) {
if (options.ignoredUpdateFiles && options.ignoredUpdateFiles.length > 0) {
return Blueprint.ignoredUpdateFiles = Blueprint.ignoredUpdateFiles.concat(options.ignoredUpdateFiles);
}
},

afterInstall: function (options) {
if (options.mobile) {
return Blueprint.load(path.join(__dirname, '../mobile')).install(options);
Expand Down
3 changes: 2 additions & 1 deletion packages/angular-cli/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ const InitCommand: any = Command.extend({
mobile: commandOptions.mobile,
routing: commandOptions.routing,
inlineStyle: commandOptions.inlineStyle,
inlineTemplate: commandOptions.inlineTemplate
inlineTemplate: commandOptions.inlineTemplate,
ignoredUpdateFiles: ['favicon.ico']
};

if (!validProjectName(packageName)) {
Expand Down
5 changes: 0 additions & 5 deletions tests/acceptance/init.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,6 @@ describe('Acceptance: ng init', function () {

it('init an already init\'d folder', function () {
return ng(['init', '--skip-npm', '--skip-bower'])
.then(function () {
// ignore the favicon file for the the unit test since it breaks at ember-cli level
// when trying to re-init
Blueprint.ignoredFiles.push('favicon.ico');
})
.then(function () {
return ng(['init', '--skip-npm', '--skip-bower']);
})
Expand Down

0 comments on commit 699ebba

Please sign in to comment.