symlink-or-copy
Advanced tools
Comparing version 1.1.8 to 1.2.0
24
index.js
@@ -7,3 +7,3 @@ var fs = require('fs') | ||
// These can be overridden for testing | ||
var options = { | ||
var defaultOptions = { | ||
isWindows: isWindows, | ||
@@ -13,2 +13,3 @@ canSymlink: testCanSymlink(), | ||
} | ||
var options = defaultOptions; | ||
@@ -39,2 +40,20 @@ function testCanSymlink () { | ||
// Test symlinking a directory. For some reason, sometimes Windows allows | ||
// symlinking a file but not symlinking a directory... | ||
try { | ||
fs.mkdirSync(canLinkSrc); | ||
} catch (e) { | ||
return false | ||
} | ||
try { | ||
fs.symlinkSync(canLinkSrc, canLinkDest, 'dir') | ||
} catch (e) { | ||
fs.rmdirSync(canLinkSrc) | ||
return false | ||
} | ||
fs.rmdirSync(canLinkSrc) | ||
fs.rmdirSync(canLinkDest) | ||
return true | ||
@@ -50,3 +69,4 @@ } | ||
function setOptions(newOptions) { | ||
options = newOptions | ||
options = newOptions || defaultOptions; | ||
} | ||
@@ -53,0 +73,0 @@ |
{ | ||
"name": "symlink-or-copy", | ||
"description": "Symlink files or directories, falling back to copying on Windows", | ||
"version": "1.1.8", | ||
"version": "1.2.0", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
@@ -20,4 +20,5 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": "^2.2.4" | ||
"mocha": "^2.2.4", | ||
"rimraf": "^2.6.2" | ||
} | ||
} |
@@ -68,4 +68,4 @@ # node-symlink-or-copy | ||
* There intentionally isn't an asynchronoukks version. It's not clear that we | ||
* There intentionally isn't an asynchronous version. It's not clear that we | ||
need or want one. Before sending a patch to add an async version, please | ||
share your use case on the issue tracker. |
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
9433
126
2