component-builder
Advanced tools
Comparing version 0.6.2 to 0.6.3
0.6.3 / 2013-02-15 | ||
================== | ||
* add configuration to copy files instead of symlink | ||
0.6.2 / 2013-01-04 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -7,2 +7,3 @@ | ||
var fs = require('fs') | ||
, cp = require('fs-extra').copy | ||
, path = require('path') | ||
@@ -40,2 +41,3 @@ , join = path.join | ||
this._js = ''; | ||
this.copy = false; | ||
this.dir = dir; | ||
@@ -97,2 +99,3 @@ this.root = ! parent; | ||
Builder.prototype.inherit = function(dep){ | ||
dep.copy = this.copy; | ||
dep._cache = this._cache; | ||
@@ -119,2 +122,13 @@ dep._hooks = this._hooks; | ||
/** | ||
* Enable "copyFiles" in the build. | ||
* | ||
* @api public | ||
*/ | ||
Builder.prototype.copyFiles = function(){ | ||
debug('copy files enabled'); | ||
this.copy = true; | ||
}; | ||
/** | ||
* Enable "sourceURLs" in the build. | ||
@@ -680,11 +694,20 @@ * | ||
Builder.prototype.copyTo = function(file, dest, fn){ | ||
var dir = dirname(dest); | ||
var dir = dirname(dest) | ||
, self = this | ||
function done(err) { | ||
if (err && 'EEXIST' == err.code) return fn(null, dest); | ||
fn(err, dest); | ||
} | ||
debug('mkdir -p %s', dir); | ||
mkdir(dir, function(err){ | ||
if (err) return fn(err); | ||
debug('link %s -> %s', file, dest); | ||
fs.symlink(file, dest, function(err){ | ||
if (err && 'EEXIST' == err.code) return fn(null, dest); | ||
fn(err, dest); | ||
}); | ||
if (self.copy){ | ||
debug('cp %s -> %s', file, dest); | ||
cp(file, dest, done); | ||
} else { | ||
debug('link %s -> %s', file, dest); | ||
fs.symlink(file, dest, done); | ||
} | ||
}); | ||
@@ -691,0 +714,0 @@ }; |
{ | ||
"name": "component-builder", | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"description": "Component build tool", | ||
@@ -15,3 +15,4 @@ "keywords": [ | ||
"debug": "*", | ||
"better-assert": "~0.1.0" | ||
"better-assert": "~0.1.0", | ||
"fs-extra": "~0.5.0" | ||
}, | ||
@@ -18,0 +19,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24836
807
6
3
+ Addedfs-extra@~0.5.0
+ Addedfs-extra@0.5.0(transitive)
+ Addedgraceful-fs@1.2.3(transitive)
+ Addedjsonfile@0.0.1(transitive)
+ Addedncp@0.2.7(transitive)
+ Addedrimraf@2.1.4(transitive)