-
Notifications
You must be signed in to change notification settings - Fork 119
Check if $id is non-zero #1
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
Conversation
You package non-statically compiled Node, so it doesn't work on systems which don't have glibc, e.g. Voidlinux. This causes $id to be an empty variable. This means `rm -r ~/.config/`. Yep, I just deleted my entire ~/.config directory by running your script.
|
Thankfully I had a backup from two weeks ago, so I only need to bring some configs up to speed. The best way to go would be to just compile Node statically, with glibc built into binary. This would avoid the issue altogether. |
I am using the official releases -> Linux Binaries (x86/x64); https://nodejs.org/en/download/current/ |
|
Looking through the It searches for a linker in /lib64 folder, which doesn't exist on musl-based 64bit distributions. So it's probably Node's fault, they didn't think about niche audience :) So this script should probably just do what One way I found, but I am not sure if it's totally correct, is to look for ldd is actually a symlink to /usr/lib/libc.so, so it should be on any Linux system. Shoul work. |
|
I am really sorry about this. Thanks for the fix. |
|
Right, I guess using the native NodeJS should be the first option. how about having something like this: MACHINE_TYPE=`uname -m`
which node 2>/dev/null
isNode=$?
echo NodeJS status = $isNode
if [ ${isNode} -eq 0 ]; then
echo "Using system NodeJS"
id=`node -e "process.stdout.write(require('./config.js').id)"`
elif [ ${MACHINE_TYPE} == 'x86_64' ]; then
echo "Using ../node/x64/node"
id=`../node/x64/node -e "process.stdout.write(require('./config.js').id)"`
else
echo "Using ../node/x86/node"
id=`../node/x86/node -e "process.stdout.write(require('./config.js').id)"`
fi |
|
Yeah, looks fine 👍 |
|
Perfect. |
I suspect you package non-statically compiled Node, so it doesn't work on systems which don't have glibc, e.g. Voidlinux.
This causes $id to be an empty variable.
This means
rm -r ~/.config/.Yep, I just deleted my entire ~/.config directory by running your script.