Skip to content

Commit 699ebba

Browse files
Puigcerberfilipesilva
authored andcommitted
fix(init): ignore favicon
Avoid crashes when choosing to diff the favicon.ico during overwrite. Closes angular#2274 Close angular#2617
1 parent ab529b7 commit 699ebba

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

packages/angular-cli/blueprints/ng2/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ module.exports = {
1616
{ name: 'inline-template', type: Boolean, default: false, aliases: ['it'] }
1717
],
1818

19+
beforeInstall: function(options) {
20+
if (options.ignoredUpdateFiles && options.ignoredUpdateFiles.length > 0) {
21+
return Blueprint.ignoredUpdateFiles = Blueprint.ignoredUpdateFiles.concat(options.ignoredUpdateFiles);
22+
}
23+
},
24+
1925
afterInstall: function (options) {
2026
if (options.mobile) {
2127
return Blueprint.load(path.join(__dirname, '../mobile')).install(options);

packages/angular-cli/commands/init.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ const InitCommand: any = Command.extend({
105105
mobile: commandOptions.mobile,
106106
routing: commandOptions.routing,
107107
inlineStyle: commandOptions.inlineStyle,
108-
inlineTemplate: commandOptions.inlineTemplate
108+
inlineTemplate: commandOptions.inlineTemplate,
109+
ignoredUpdateFiles: ['favicon.ico']
109110
};
110111

111112
if (!validProjectName(packageName)) {

tests/acceptance/init.spec.js

-5
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,6 @@ describe('Acceptance: ng init', function () {
148148

149149
it('init an already init\'d folder', function () {
150150
return ng(['init', '--skip-npm', '--skip-bower'])
151-
.then(function () {
152-
// ignore the favicon file for the the unit test since it breaks at ember-cli level
153-
// when trying to re-init
154-
Blueprint.ignoredFiles.push('favicon.ico');
155-
})
156151
.then(function () {
157152
return ng(['init', '--skip-npm', '--skip-bower']);
158153
})

0 commit comments

Comments
 (0)