mirror of
https://github.com/logos-storage/logos-storage-nim.git
synced 2026-05-21 02:39:28 +00:00
fix hardhat running on windows
Solution was two-fold: 1. Run the hardhat.cmd script instead of hardhat 2. Use the absolute path to the script executable instead of relative to the working directory
This commit is contained in:
parent
98df5bf2ec
commit
99d161ba1b
@ -36,7 +36,10 @@ method workingDir(node: HardhatProcess): string =
|
|||||||
return currentSourcePath() / ".." / ".." / ".." / "vendor" / "codex-contracts-eth"
|
return currentSourcePath() / ".." / ".." / ".." / "vendor" / "codex-contracts-eth"
|
||||||
|
|
||||||
method executable(node: HardhatProcess): string =
|
method executable(node: HardhatProcess): string =
|
||||||
return "node_modules" / ".bin" / "hardhat"
|
return "node_modules" / ".bin" / (when defined(windows):
|
||||||
|
"hardhat.cmd"
|
||||||
|
else:
|
||||||
|
"hardhat")
|
||||||
|
|
||||||
method startedOutput(node: HardhatProcess): string =
|
method startedOutput(node: HardhatProcess): string =
|
||||||
return "Started HTTP and WebSocket JSON-RPC server at"
|
return "Started HTTP and WebSocket JSON-RPC server at"
|
||||||
@ -65,25 +68,26 @@ method start*(
|
|||||||
logScope:
|
logScope:
|
||||||
nodeName = node.name
|
nodeName = node.name
|
||||||
|
|
||||||
|
var executable = ""
|
||||||
try:
|
try:
|
||||||
let binary = absolutePath(node.workingDir / node.executable)
|
executable = absolutePath(node.workingDir / node.executable)
|
||||||
if not fileExists(binary):
|
if not fileExists(executable):
|
||||||
raiseAssert "cannot start hardhat, binary doesn't exist (looking for " &
|
raiseAssert "cannot start hardhat, executable doesn't exist (looking for " &
|
||||||
&"{binary}). Try running `npm install` in {node.workingDir}."
|
&"{executable}). Try running `npm install` in {node.workingDir}."
|
||||||
except CatchableError as parent:
|
except CatchableError as parent:
|
||||||
raiseAssert "failed build path to hardhat executable: " & parent.msg
|
raiseAssert "failed build path to hardhat executable: " & parent.msg
|
||||||
|
|
||||||
let poptions = node.processOptions + {AsyncProcessOption.StdErrToStdOut}
|
let poptions = node.processOptions + {AsyncProcessOption.StdErrToStdOut}
|
||||||
|
|
||||||
trace "starting node",
|
trace "starting node",
|
||||||
args = node.arguments,
|
args,
|
||||||
executable = node.executable,
|
executable,
|
||||||
workingDir = node.workingDir,
|
workingDir = node.workingDir,
|
||||||
processOptions = poptions
|
processOptions = poptions
|
||||||
|
|
||||||
try:
|
try:
|
||||||
node.process = await startProcess(
|
node.process = await startProcess(
|
||||||
node.executable,
|
executable,
|
||||||
node.workingDir,
|
node.workingDir,
|
||||||
@["node"].concat(node.arguments),
|
@["node"].concat(node.arguments),
|
||||||
options = poptions,
|
options = poptions,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user