Skip to content

Commit 11da894

Browse files
author
benholloway
committed
sync
2 parents 14566b7 + 5cbc9e4 commit 11da894

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angularity",
33
"description": "An oppionated node-js build system for Ecmascript-6 Angular-js projects",
4-
"version": "0.0.19",
4+
"version": "0.0.20",
55
"tags": [
66
"build",
77
"system",

tasks/init.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,11 @@ gulp.task('init:karma', function () {
304304
});
305305

306306
gulp.task('init:jshint', function () {
307-
writeTemplate('.jshintrc');
307+
copyTemplateSync('.jshintrc');
308308
});
309309

310310
gulp.task('init:gitignore', function () {
311-
writeTemplate('.gitignore');
311+
copyTemplateSync('.gitignore');
312312
});
313313

314314
function padded(length) {
@@ -359,4 +359,15 @@ function writeTemplate(filename, subdir) {
359359
fs.writeFileSync(destAbsolute, merged);
360360
gutil.log('created file ' + destRelative);
361361
}
362+
}
363+
364+
function copyTemplateSync(filename, subdir) {
365+
var srcAbsolute = path.join(TEMPLATE_PATH, filename);
366+
var destRelative = path.join(subdir || '.', filename);
367+
var destAbsolute = path.resolve(destRelative);
368+
if (fs.existsSync(srcAbsolute) && !fs.existsSync(destAbsolute)) {
369+
var templateContent = fs.readFileSync(srcAbsolute).toString();
370+
fs.writeFileSync(destAbsolute, templateContent);
371+
gutil.log('created file ' + destRelative);
372+
}
362373
}

0 commit comments

Comments
 (0)