Permalink
Browse files

Prevent hidden files (like .svn folders) from being copied from templ…

…ate. Fixes #40
  • Loading branch information...
1 parent 2f8f170 commit f4896cd250d3858898d03d225426993369072819 @JohnAlbin JohnAlbin committed Jul 22, 2014
Showing with 13 additions and 3 deletions.
  1. +12 −2 bin/kss-node
  2. +1 −1 package.json
View
@@ -79,7 +79,13 @@ if (argv.init) {
}
console.log('Creating a new styleguide template...');
- wrench.copyDirSyncRecursive( __dirname + '/../lib/template', argv.init );
+ try {
+ wrench.copyDirSyncRecursive( __dirname + '/../lib/template', argv.init );
+ }
+ catch (e) {
+ console.log('Error! ' + argv.init + ' already exists.');
+ return;
+ }
console.log('You can change it as you like, and use it with your styleguide like so:');
console.log('');
console.log('kss-node [sourcedir] --template "'+argv.init+'"');
@@ -115,7 +121,11 @@ try {
wrench.copyDirSyncRecursive(
config.templateDirectory + '/public',
- config.destinationDirectory + '/public'
+ config.destinationDirectory + '/public',
+ {
+ forceDelete: true,
+ excludeHiddenUnix: true
+ }
);
// Generate the static HTML pages in the next tick, i.e. after the other functions have
View
@@ -22,7 +22,7 @@
"marked": "0.1.x",
"natural": "0.0.65",
"handlebars": "1.3.x",
- "wrench": "1.3.x",
+ "wrench": "1.5.x",
"less": "1.x.x",
"stylus": "0.46.x",
"sass": "0.5.x",

0 comments on commit f4896cd

Please sign in to comment.