Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added ncp filter to not copy dot directories or files and node_module…

…s directory.
  • Loading branch information...
commit 297a29cfe49172b21dfa610a088a85dc594a7bfc 1 parent 869c104
@davglass authored
Showing with 12 additions and 3 deletions.
  1. +12 −3 lib/module.js
View
15 lib/module.js
@@ -17,6 +17,15 @@ var Stack = require('./stack').Stack,
Queue = require('gear').Queue,
Registry = require('gear').Registry,
registry,
+ ncpOptions = {
+ filter: function (name) {
+ var base = path.basename(name);
+ if (base.indexOf('.') === 0 || base === 'node_modules') {
+ return false;
+ }
+ return true;
+ }
+ },
cName = {
compressor: 'YUICompressor',
jsminify: 'UglifyJS'
@@ -394,7 +403,7 @@ var copyAssets = function (mod, name, callback) {
if (exists(from)) {
log.info('shifting assets for ' + name);
- ncp(from, to, callback);
+ ncp(from, to, ncpOptions, callback);
} else {
callback();
}
@@ -415,7 +424,7 @@ var buildSkin = function (mod, name, callback) {
}
if (exists(from)) {
- ncp(from, to, stack.add(function () {
+ ncp(from, to, ncpOptions, stack.add(function () {
//Get list of Skins
fs.readdir(path.join(process.cwd(), 'assets', subMod, 'skins'), stack.add(function (err, skins) {
if (err) {
@@ -513,7 +522,7 @@ var buildCopy = function (mod, name, callback) {
toDir;
if (stat.isDirectory()) {
- ncp(from, to, function () {
+ ncp(from, to, ncpOptions, function () {
copy();
});
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.