From 63db115257afba62c619c829e1662b5677b66efb Mon Sep 17 00:00:00 2001 From: "Kenneth G. Franqueiro" Date: Mon, 22 Jun 2015 21:22:12 -0400 Subject: [PATCH] Fix path separator replacement for ignore on Windows This needs to be done when Windows is the host OS regardless of the target platform, not vice versa. Fixes #79. --- common.js | 4 ++-- linux.js | 2 +- win32.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common.js b/common.js index 80500e3..2d194a0 100644 --- a/common.js +++ b/common.js @@ -27,9 +27,9 @@ module.exports = { } }, - userIgnoreFilter: function userIgnoreFilter (opts, is_win32, finalDir) { + userIgnoreFilter: function userIgnoreFilter (opts, finalDir) { return function filter (file) { - if (is_win32) { + if (path.sep === '\\') { // convert slashes so unix-format ignores work file = file.replace(/\\/g, '/') } diff --git a/linux.js b/linux.js index 7622fa3..1c0770a 100644 --- a/linux.js +++ b/linux.js @@ -26,7 +26,7 @@ module.exports = { } function copyUserApp () { - ncp(opts.dir, userAppDir, {filter: common.userIgnoreFilter(opts, false, finalDir), dereference: true}, function copied (err) { + ncp(opts.dir, userAppDir, {filter: common.userIgnoreFilter(opts, finalDir), dereference: true}, function copied (err) { if (err) return cb(err) common.prune(opts, userAppDir, cb, renameElectronBinary) }) diff --git a/win32.js b/win32.js index bc3eb81..6699fe1 100644 --- a/win32.js +++ b/win32.js @@ -50,7 +50,7 @@ function buildWinApp (opts, cb, newApp) { } // copy users app into destination path - ncp(opts.dir, paths.app, {filter: common.userIgnoreFilter(opts, true), dereference: true}, function copied (err) { + ncp(opts.dir, paths.app, {filter: common.userIgnoreFilter(opts), dereference: true}, function copied (err) { if (err) return cb(err) function moveApp () {