From 8f96b2bca9913a3712020501de05843f8ec765ad Mon Sep 17 00:00:00 2001 From: mc007 Date: Sat, 5 Nov 2016 16:44:54 +0100 Subject: [PATCH] =fixed toAbsolute for exists check instead of joining blindly --- bin/nexe | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/nexe b/bin/nexe index 1083ed6..9d12495 100755 --- a/bin/nexe +++ b/bin/nexe @@ -72,11 +72,17 @@ if (argv.h || argv.help) { * TODO: Support network shares? **/ function toAbsolute(pt) { + //already resolved? + try{ + fs.accessSync(pt,fs.F_OK); + return pt; + }catch(e){} + if (pt.substr(0, 1) == "/") return pt; // for *nix "/" if (pt.substr(0, 2) == "\\\\") return pt; // for windows "\\" if (pt.substr(1, 3) == ":/") return pt; // for windows "c:/" - // otheerwise... + // otherwise... return path.join(process.cwd(), pt); }