Use script-relative paths for launchers

This commit is contained in:
hensm
2020-08-12 10:06:34 +01:00
committed by Matt Hensman
parent 10c92186f9
commit 68fe261a00

View File

@@ -159,7 +159,7 @@ async function build () {
`@echo off `@echo off
setlocal setlocal
set NODE_PATH=${modulesDir} set NODE_PATH=${modulesDir}
node .\\src\\main.js %* node %~dp0src\\main.js %*
endlocal endlocal
`); `);
break; break;
@@ -170,7 +170,7 @@ endlocal
launcherPath += ".sh"; launcherPath += ".sh";
fs.writeFileSync(launcherPath, fs.writeFileSync(launcherPath,
`#!/usr/bin/env sh `#!/usr/bin/env sh
NODE_PATH="${modulesDir}" node ./src/main.js "$@" NODE_PATH="${modulesDir}" node $(dirname $0)/src/main.js "$@"
`); `);
break; break;
} }