symlink-or-copy
Advanced tools
Comparing version 1.1.2 to 1.1.3
# master | ||
# 1.1.3 | ||
* [BUGFIX}] Instruct Win32 to suspend path parsing by prefixing the path with a \\?\. | ||
# 1.1.2 | ||
@@ -4,0 +8,0 @@ |
11
index.js
@@ -82,2 +82,6 @@ var fs = require('fs') | ||
// Instruct Win32 to suspend path parsing by prefixing the path with a \\?\. | ||
// Fix for https://github.com/broccolijs/broccoli-merge-trees/issues/42 | ||
var WINDOWS_PREFIX = "\\\\?\\"; | ||
function symlinkWindows(srcPath, destPath) { | ||
@@ -94,7 +98,10 @@ var stat = options.fs.lstatSync(srcPath) | ||
srcPath = WINDOWS_PREFIX + (wasResolved ? srcPath : path.resolve(srcPath)); | ||
destPath = WINDOWS_PREFIX + path.resolve(path.normalize(destPath)); | ||
if (options.canSymlink) { | ||
options.fs.symlinkSync(wasResolved ? srcPath : path.resolve(srcPath), destPath, isDir ? 'dir' : 'file') | ||
options.fs.symlinkSync(srcPath, destPath, isDir ? 'dir' : 'file'); | ||
} else { | ||
if (isDir) { | ||
options.fs.symlinkSync(wasResolved ? srcPath : path.resolve(srcPath), destPath, 'junction'); | ||
options.fs.symlinkSync(srcPath, destPath, 'junction'); | ||
} else { | ||
@@ -101,0 +108,0 @@ options.fs.writeFileSync(destPath, options.fs.readFileSync(srcPath), { flag: 'wx', mode: stat.mode }) |
{ | ||
"name": "symlink-or-copy", | ||
"description": "Symlink files or directories, falling back to copying on Windows", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -113,3 +113,3 @@ var assert = require('assert'); | ||
}); | ||
symLinkOrCopy.sync(); | ||
symLinkOrCopy.sync('foo', 'bar'); | ||
assert.equal(count, 3); | ||
@@ -116,0 +116,0 @@ }) |
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
11977
230