HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //home/ubuntu/.nvm/test/sourcing/Sourcing nvm.sh with --install and .nvmrc should install it
#!/bin/sh

die () { echo "$@" ; exit 1; }
supports_source_options () {
  [ "_$(echo 'echo $1' | . /dev/stdin yes)" = "_yes" ]
}

if ! supports_source_options; then
  echo 'this shell does not support passing options on sourcing'
  exit 0;
fi

echo '0.10.2' > ../../.nvmrc || die 'creation of .nvmrc failed'

\. ../../nvm.sh --install
EXIT_CODE="$(echo $?)"

echo 'sourcing complete.'

nvm_version 0.10.2 >/dev/null 2>&1 || die "v0.10.2 not installed: $(nvm ls)"

[ "_$(nvm_rc_version | \grep -o -e 'with version .*$')" = "_with version <0.10.2>" ] || die "nvm_rc_version $(nvm_rc_version)"

[ "_$EXIT_CODE" = "_0" ] || die "sourcing returned nonzero exit code: $EXIT_CODE"

NVM_LS_CURRENT="$(nvm ls current | \grep -o v0.10.2)"
[ "_$NVM_LS_CURRENT" = '_v0.10.2' ] || die "'nvm ls current' did not return '-> v0.10.2', got '$NVM_LS_CURRENT' `nvm ls`"