From 2beaa7a2da40e336b9606949ba65e0631c775767 Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Sat, 24 Jan 2015 18:02:00 -0600 Subject: find the nodejs binary upstream calls it node, debian calls it nodejs. We gotta look for both of them. --- compiler/nim.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'compiler') diff --git a/compiler/nim.nim b/compiler/nim.nim index a87e0a1ac..553c4635f 100644 --- a/compiler/nim.nim +++ b/compiler/nim.nim @@ -15,7 +15,8 @@ when defined(gcc) and defined(windows): import commands, lexer, condsyms, options, msgs, nversion, nimconf, ropes, - extccomp, strutils, os, osproc, platform, main, parseopt, service + extccomp, strutils, os, osproc, platform, main, parseopt, service, + nodejs when hasTinyCBackend: import tccgen @@ -67,7 +68,7 @@ proc handleCmdLine() = else: ex = quoteShell( completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir)) - execExternalProgram("node " & ex & ' ' & commands.arguments) + execExternalProgram(findNodeJs & " " & ex & ' ' & commands.arguments) else: var binPath: string if options.outFile.len > 0: -- cgit 1.4.1-2-gfad0 From 842c7f67ca06266d99577a31718ae1084cde033d Mon Sep 17 00:00:00 2001 From: Simon Hafner Date: Tue, 27 Jan 2015 13:04:27 -0600 Subject: added suggested fixes --- compiler/nim.nim | 2 +- lib/core/nodejs.nim | 6 ------ lib/pure/nodejs.nim | 6 ++++++ 3 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 lib/core/nodejs.nim create mode 100644 lib/pure/nodejs.nim (limited to 'compiler') diff --git a/compiler/nim.nim b/compiler/nim.nim index 553c4635f..c420f6f30 100644 --- a/compiler/nim.nim +++ b/compiler/nim.nim @@ -68,7 +68,7 @@ proc handleCmdLine() = else: ex = quoteShell( completeCFilePath(changeFileExt(gProjectFull, "js").prependCurDir)) - execExternalProgram(findNodeJs & " " & ex & ' ' & commands.arguments) + execExternalProgram(findNodeJs() & " " & ex & ' ' & commands.arguments) else: var binPath: string if options.outFile.len > 0: diff --git a/lib/core/nodejs.nim b/lib/core/nodejs.nim deleted file mode 100644 index e2b79df19..000000000 --- a/lib/core/nodejs.nim +++ /dev/null @@ -1,6 +0,0 @@ -import os - -proc findNodeJs*(): string = - result = findExe("nodejs") - if result == "": - result = findExe("node") diff --git a/lib/pure/nodejs.nim b/lib/pure/nodejs.nim new file mode 100644 index 000000000..e2b79df19 --- /dev/null +++ b/lib/pure/nodejs.nim @@ -0,0 +1,6 @@ +import os + +proc findNodeJs*(): string = + result = findExe("nodejs") + if result == "": + result = findExe("node") -- cgit 1.4.1-2-gfad0