remove dead builder.copyDirectory({depend:true}) code

This commit is contained in:
David Glasser
2013-07-31 14:15:08 -07:00
parent ad5b20990e
commit 3f5edbfae9
3 changed files with 4 additions and 22 deletions

View File

@@ -289,9 +289,7 @@ _.extend(Builder.prototype, {
// bundle. But if the symlink option was passed to the Builder
// constructor, then make a symlink instead, if possible.
//
// Adds dependencies both on the files that were copied, and on the
// contents of the directory tree (respecting 'ignore'.) Disable
// this with depend: false.
// This does NOT add any dependencies.
//
// Options:
// - from: source path on local disk to copy from
@@ -300,14 +298,10 @@ _.extend(Builder.prototype, {
// - ignore: array of regexps of filenames (that is, basenames) to
// ignore (they may still be visible in the output bundle if
// symlinks are being used)
// - depend: Should dependencies be added? Defaults to true.
copyDirectory: function (options) {
var self = this;
options = options || {};
var createDependencies =
('depend' in options) ? options.depend : true;
var normOptionsTo = options.to;
if (normOptionsTo.slice(-1) === path.sep)
normOptionsTo = normOptionsTo.slice(0, -1);
@@ -343,12 +337,6 @@ _.extend(Builder.prototype, {
}
var ignore = options.ignore || [];
if (createDependencies) {
self.dependencyInfo.directories[absPathTo] = {
include: [/.?/],
exclude: ignore
};
}
var walk = function (absFrom, relTo) {
self._ensureDirectory(relTo);
@@ -368,9 +356,6 @@ _.extend(Builder.prototype, {
// XXX avoid reading whole file into memory
var data = fs.readFileSync(thisAbsFrom);
if (createDependencies)
self.dependencyInfo.files[thisAbsFrom] = sha1(data);
fs.writeFileSync(path.resolve(self.buildPath, thisRelTo), data);
self.usedAsFile[thisRelTo] = true;
});

View File

@@ -1105,8 +1105,7 @@ _.extend(JsImage.prototype, {
_.each(nodeModulesDirectories, function (nmd) {
builder.copyDirectory({
from: nmd.sourcePath,
to: nmd.preferredBundlePath,
depend: false
to: nmd.preferredBundlePath
});
});
@@ -1321,8 +1320,7 @@ _.extend(ServerTarget.prototype, {
builder.copyDirectory({
from: path.join(files.get_dev_bundle(), 'lib', 'node_modules'),
to: 'node_modules',
ignore: ignoreFiles,
depend: false
ignore: ignoreFiles
});
}

View File

@@ -2355,8 +2355,7 @@ _.extend(Package.prototype, {
if (slice.nodeModulesPath) {
builder.copyDirectory({
from: slice.nodeModulesPath,
to: 'npm/node_modules',
depend: false
to: 'npm/node_modules'
});
}