broccoli-merge-trees
Advanced tools
Comparing version 0.2.0 to 0.2.1
# master | ||
# 0.2.1 | ||
* Use node-symlink-or-copy to enable possible future symlink support on Windows | ||
# 0.2.0 | ||
@@ -4,0 +8,0 @@ |
14
index.js
@@ -7,4 +7,2 @@ var fs = require('fs') | ||
var isWindows = process.platform === 'win32' | ||
module.exports = TreeMerger | ||
@@ -121,3 +119,3 @@ TreeMerger.prototype = Object.create(Writer.prototype) | ||
if (infoHash.isDirectory) { | ||
if (isWindows || infoHash.indices.length > 1) { | ||
if (infoHash.indices.length > 1) { | ||
// Copy/merge subdirectory | ||
@@ -130,11 +128,3 @@ if (infoHash.indices[0] === i) { // avoid duplicate recursion | ||
// Symlink entire subdirectory | ||
if (fs.lstatSync(fullPath).isSymbolicLink()) { | ||
// When we encounter symlinks, follow them. This prevents indirection | ||
// from growing out of control. Note: At the moment `realpath` on Node | ||
// is 70x slower than native: https://github.com/joyent/node/issues/7902 | ||
fullPath = fs.realpathSync(fullPath) | ||
} else if (fullPath[0] !== path.sep) { | ||
fullPath = process.cwd() + path.sep + fullPath | ||
} | ||
fs.symlinkSync(fullPath, destPath) | ||
symlinkOrCopySync(fullPath, destPath) | ||
} | ||
@@ -141,0 +131,0 @@ } else { // isFile |
{ | ||
"name": "broccoli-merge-trees", | ||
"description": "Broccoli plugin to merge multiple trees into one", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
var Writer = require('broccoli-writer') | ||
var RSVP = require('rsvp') | ||
var Promise = require('rsvp').Promise | ||
var ncp = require('ncp') | ||
@@ -22,3 +21,3 @@ var fixturify = require('fixturify') | ||
function readTree (tree) { | ||
return Promise.resolve().then(function () { | ||
return RSVP.resolve().then(function () { | ||
// Plain directory path? | ||
@@ -31,3 +30,3 @@ if (typeof tree === 'string') return tree | ||
if (self.treesToCleanUp.indexOf(tree) === -1) self.treesToCleanUp.push(tree) | ||
return Promise.resolve(tree.read(readTree)) | ||
return RSVP.resolve(tree.read(readTree)) | ||
.then(function (dir) { | ||
@@ -34,0 +33,0 @@ trees.push(tree) |
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
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
21573
212