Skip to content
This repository was archived by the owner on Oct 17, 2019. It is now read-only.

Commit 24f321f

Browse files
committed
Update ignores list
1 parent 6b71316 commit 24f321f

File tree

2 files changed

+32
-19
lines changed

2 files changed

+32
-19
lines changed

app/index.js

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,55 @@ Generator.prototype.copyFiles = function (arg) {
6161
];
6262

6363
var ignores = [
64+
'.editorconfig',
6465
'.git',
6566
'.gitattributes',
66-
'.gitignores',
67+
'.gitignore',
6768
'.jshintrc',
68-
'.travis',
69+
'.travis.yml',
6970
'CHANGELOG.md',
7071
'CONTRIBUTING.md',
71-
'doc',
7272
'LICENSE.md',
73-
'test',
74-
'README.md'
73+
'README.md',
74+
'bin',
75+
'bower.json',
76+
'doc',
77+
'src',
78+
'test'
7579
];
7680

7781
var fetch = function (configs) {
7882

7983
var configsPath = path.join(this.sourceRoot(), configs.server);
8084

85+
// Only the `node` server configs require the `package.json` file
86+
if (configs.server !== 'node' ) {
87+
ignores.push('package.json');
88+
}
89+
8190
this.tarball(configs.url, configsPath, function () {
8291

83-
this.expand('*', {
84-
cwd: configsPath,
85-
dot: true
86-
}).forEach(function (elem) {
92+
if (configs.server == "apache" ) {
93+
this.copy(path.join(configsPath, 'dist', '.htaccess'), '.htaccess');
94+
95+
} else {
96+
this.expand('*', {
97+
cwd: configsPath,
98+
dot: true
99+
}).forEach(function (elem) {
87100

88-
var tmplPath = path.join(configs.server, elem);
101+
var tmplPath = path.join(configs.server, elem);
89102

90-
if ( ignores.indexOf(elem) === -1 ) {
91-
if ( fs.lstatSync(path.join(configsPath, elem)).isDirectory() === true ) {
92-
this.directory(tmplPath, elem);
93-
} else {
94-
this.copy(tmplPath, elem);
103+
if ( ignores.indexOf(elem) === -1 ) {
104+
if ( fs.lstatSync(path.join(configsPath, elem)).isDirectory() === true ) {
105+
this.directory(tmplPath, elem);
106+
} else {
107+
this.copy(tmplPath, elem);
108+
}
95109
}
96-
}
97110

98-
}, this);
111+
}, this);
112+
}
99113

100114
cb();
101115

@@ -136,7 +150,6 @@ Generator.prototype.copyFiles = function (arg) {
136150
// remove `doc` from `ignores`
137151
if ( props.includeDocs === true ) {
138152
ignores.splice(ignores.indexOf('doc'), 1);
139-
140153
}
141154

142155
fetch(props.choice);

test/test-file-creation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('H5BP Server Configs generator', function () {
1919
});
2020

2121
it('`apache` option generates expected files', function (cb) {
22-
var expected = [ path.join('dist', '.htaccess') ];
22+
var expected = [ path.join('.htaccess') ];
2323

2424
this.generator.run(['apache'], function () {
2525
helpers.assertFiles(expected);

0 commit comments

Comments
 (0)