New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host script not executed #46
Comments
Give paths relative to process.cwd(), which should be |
I've changed the path with retog/scuttle-shell-browser@fc6a41f, the script still doesn't work when run via
|
The approach described here https://stackoverflow.com/a/3133313/1455912 might work when the application is installed globally. It wouldn't by itself work with |
Released v4.8.2 |
Hi @asamuzaK, unfortunately, this doesn't solve the problem as it still using cwd. A patch that is irrelevant when the script is installed somewhere in the path or run with npx. Using absolute path is not an option, they should be relative to the location of the script rather than relative to the current working directory. |
If you pass the absolute path of the main script file, it doesn't matter what process.cwd() is. Added some more tests to verify. |
I don't know the absolute path if it is installed with |
process.argv[1] contains script path. So I think you can get the path of mainScriptFile something like this.
|
Thanks @asamuzaK for your suggestions. Unfortunately when installing my project a sym-link to the script is created an process.argv[1] contains the path to the sym-link rather than it's target.
|
How about below?
|
Thanks, @asamuzaK, that helped! It now works perfectly both when run from the source folder as well as when installed globally. A remaining issue is a situation when it's run with |
It's out of scope for this module and is a waste of disk space. |
Can close? |
Hi @asamuzaK, I understand that making the project run with I can do that in my project by wrapping around The only not so nice part is that I have to meddle around with a method starting with '_' rather than using an actually exposed function, but it works for me and this issue can be closed. Thanks for your support! |
FYI
|
I've configured the setup script to e the default binary of the project. The idea was, to allow easy installation with
However, this generates a launch script that start node without the main script file:
Things are working when I run the setup script from the project folder with
node setup/native-host.js
.Any help would be greatly appreciated. My project is here: https://github.com/retog/scuttle-shell-browser/
The text was updated successfully, but these errors were encountered: