Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit ef38e66

Browse files
committed
chore(ignored/boilerplate files): cleanup
1 parent 1cc5284 commit ef38e66

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ pubspec.lock
1212
.DS_Store
1313
**/*.iml
1414
.idea
15+
.vscode
1516
**/js/latest/api
1617
**/ts/latest/api
1718
**/dart/latest/api
@@ -21,8 +22,7 @@ _.*
2122
public/docs/xref-*.*
2223
_zip-output
2324
www
24-
npm-debug.log
25-
npm-debug.log.*
25+
npm-debug*.log*
2626
*.plnkr.html
2727
plnkr.html
2828
*plnkr.no-link.html

gulpfile.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,24 +398,28 @@ function copyExampleBoilerplate() {
398398
var sourceFiles = _exampleBoilerplateFiles.map(function(fn) {
399399
return path.join(EXAMPLES_PATH, fn);
400400
});
401-
var examplePaths = getExamplePaths(EXAMPLES_PATH);
401+
var _examplePaths = getExamplePaths(EXAMPLES_PATH);
402+
// Exclude Dart paths since they are processed separately.
403+
var examplePaths = _examplePaths.filter(function (p) { return p.match('/dart(/|$)') == null; });
402404

403405
var dartWebSourceFiles = _exampleDartWebBoilerPlateFiles.map(function(fn){
404406
return path.join(EXAMPLES_PATH, fn);
405407
});
406408
var dartExampleWebPaths = getDartExampleWebPaths(EXAMPLES_PATH);
407409

408-
return copyFiles(sourceFiles, examplePaths)
410+
// Make boilerplate files read-only to avoid that they be edited by mistake.
411+
var destFileMode = '444';
412+
return copyFiles(sourceFiles, examplePaths, destFileMode)
409413
.then(function() {
410-
return copyFiles(dartWebSourceFiles, dartExampleWebPaths);
414+
return copyFiles(dartWebSourceFiles, dartExampleWebPaths, destFileMode);
411415
})
412416
// copy certain files from _examples/_protractor dir to each subdir that contains an e2e-spec file.
413417
.then(function() {
414418
var protractorSourceFiles =
415419
_exampleProtractorBoilerplateFiles
416420
.map(function(name) {return path.join(EXAMPLES_PROTRACTOR_PATH, name);});;
417421
var e2eSpecPaths = getE2eSpecPaths(EXAMPLES_PATH);
418-
return copyFiles(protractorSourceFiles, e2eSpecPaths);
422+
return copyFiles(protractorSourceFiles, e2eSpecPaths, destFileMode);
419423
});
420424
}
421425

@@ -789,16 +793,23 @@ function showHideExampleNodeModules(showOrHide) {
789793
}
790794
}
791795

792-
796+
// Copies fileNames into destPaths, setting the mode of the
797+
// files at the destination as optional_destFileMode if given.
793798
// returns a promise
794-
function copyFiles(fileNames, destPaths) {
799+
function copyFiles(fileNames, destPaths, optional_destFileMode) {
795800
var copy = Q.denodeify(fsExtra.copy);
801+
var chmod = Q.denodeify(fsExtra.chmod);
796802
var copyPromises = [];
797803
destPaths.forEach(function(destPath) {
798804
fileNames.forEach(function(fileName) {
799805
var baseName = path.basename(fileName);
800806
var destName = path.join(destPath, baseName);
801807
var p = copy(fileName, destName, { clobber: true});
808+
if(optional_destFileMode !== undefined) {
809+
p = p.then(function () {
810+
return chmod(destName, optional_destFileMode);
811+
});
812+
}
802813
copyPromises.push(p);
803814
});
804815
});

public/docs/_examples/.gitignore

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
1+
# _exampleBoilerplateFiles
12
.editorconfig
2-
.idea
3-
.vscode
4-
styles.css
5-
typings
6-
typings.json
7-
node_modules
8-
jspm_packages
9-
*.js.map
10-
package.json
113
karma.conf.js
124
karma-test-shim.js
5+
package.json
6+
*/**/styles.css
7+
systemjs.config.js
138
tsconfig.json
149
tslint.json
10+
typings.json
1511
wallaby.js
16-
npm-debug*.
12+
1713
protractor.config.js
18-
systemjs.config.js
1914
_test-output
20-
_temp
2115
**/ts/**/*.js
2216
**/ts-snippets/**/*.js
2317
*.d.ts

0 commit comments

Comments
 (0)