From 74ed9ca300a069092d5d3e62f8716a568aa25872 Mon Sep 17 00:00:00 2001 From: jamon Date: Fri, 27 Sep 2013 14:54:01 -0500 Subject: [PATCH 1/2] add support for symlinking (junctions) on win32 --- src/cp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cp.js b/src/cp.js index a1bc529..9fb99e7 100644 --- a/src/cp.js +++ b/src/cp.js @@ -72,7 +72,7 @@ function cpdirSyncRecursive(sourceDir, destDir, opts) { cpdirSyncRecursive(srcFile, destFile, opts); } else if (srcFileStat.isSymbolicLink()) { var symlinkFull = fs.readlinkSync(srcFile); - fs.symlinkSync(symlinkFull, destFile); + fs.symlinkSync(symlinkFull, destFile, os.platform() === "win32" ? "junction" : null); } else { /* At this point, we've hit a file actually worth copying... so copy it on over. */ if (fs.existsSync(destFile) && !opts.force) { From bb26fe2915b60317fa792ea6b04e981dbab90be1 Mon Sep 17 00:00:00 2001 From: jamon Date: Thu, 3 Oct 2013 09:19:40 -0500 Subject: [PATCH 2/2] fixed not passing tests due to not requiring 'os' before use --- src/cp.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cp.js b/src/cp.js index 9fb99e7..141d8e3 100644 --- a/src/cp.js +++ b/src/cp.js @@ -1,6 +1,7 @@ var fs = require('fs'); var path = require('path'); var common = require('./common'); +var os = require('os'); // Buffered file copy, synchronous // (Using readFileSync() + writeFileSync() could easily cause a memory overflow