⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.108
Server IP:
97.74.83.112
Server:
Linux 112.83.74.97.host.secureserver.net 5.14.0-611.54.6.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Fri May 15 04:23:18 EDT 2026 x86_64
Server Software:
Apache
PHP Version:
8.2.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
trinadezambia
/
.nvm
/
test
/
installation_node
/
View File Name :
install on bash with ERR trap and set -E
#!/bin/sh set -e cleanup() { nvm cache clear nvm deactivate rm -rf "${NVM_DIR}"/v* nvm unalias default } die() { echo "$@" cleanup || true exit 1 } \. ../../nvm.sh if [ -z "${BASH-}" ]; then echo "This test only applies to Bash; skipping" exit fi cleanup || true trap 'echo "==> EXIT signal received (status: $?)"; cleanup' EXIT # shellcheck disable=SC3047 trap 'echo "==> ERR signal received"; exit 1' ERR # shellcheck disable=SC3041 set -E # shellcheck disable=SC3045,SC3047 ERR_TRAP_EXPECTED="$(trap -p ERR)" # Adding ` || die 'install failed'` implicitly disables error handling and # prevents ERR trap execution, so for the purposes of this test, `nvm install` # can't be part of another command or statement nvm install node case "$-" in *E*) # shellcheck disable=SC3045,SC3047 [ "$(trap -p ERR)" = "$ERR_TRAP_EXPECTED" ] || die "ERR trap not restored after \"nvm install $VERSION\"" ;; *) die "errtrace not restored after \"nvm install $VERSION\"" ;; esac