From c43a5705afe39f147160bc4d46ba0fa1473c718c Mon Sep 17 00:00:00 2001 From: Franz Geiger Date: Fri, 6 Jan 2023 11:01:38 +0100 Subject: [PATCH] Fix: Cannot find module '${HOME}/host.js' It appears that Firefox starts the native client from `$HOME` as the working directory. That leads to the script resolving the relative path host.js as `$HOME/host.js`. This fix prefixes the `host.js` filename with the directory of the run.sh file. Now it works regardless of the working directory and regardless of the directory in which `run.sh` and the JavaScript files are located (as long as they are in the same location). Fix: andy-portmen/native-client#118 --- linux/app/install.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/app/install.js b/linux/app/install.js index cc36a4a..7bedbdb 100644 --- a/linux/app/install.js +++ b/linux/app/install.js @@ -86,7 +86,7 @@ function application() { return reject(e); } const isNode = process.argv.filter(a => a === '--add_node').length === 0; - const run = `#!/usr/bin/env bash\n${isNode ? process.argv[0] : './node'} host.js`; + const run = `#!/usr/bin/env bash\n${isNode ? process.argv[0] : './node'} $(dirname "$0")/host.js`; fs.writeFile(path.join(dir, 'run.sh'), run, e => { if (e) { return reject(e);