HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/rvm/rvm-test-rvm1/pwd_cd_hook_comment_test.sh
source "$rvm_path/scripts/rvm"
source "$rvm_path/scripts/functions/rvmrc_project"
rvm_scripts_path="$rvm_path/scripts" rvm_project_rvmrc=cd source "$rvm_path/scripts/cd"

: setup basic
true TMPDIR:${TMPDIR:=/tmp}:
d=$TMPDIR/test-rvm-pwd-hook
mkdir -p $d/.rvm/hooks
f=$d/.rvm/hooks/after_cd_test
echo "echo test it" > $f
chmod +x $f

: test not trusted
cd $d
# match!=/^test it$/
# status=0

: test trusted
rvm rvmrc trust $f
cd $d
# match=/^test it$/
# status=0

: test untrusted
rvm rvmrc reset $f
cd $d
# match!=/^test it$/
# status=0

: cleanup
rm -rf $d

: setup spaces
true TMPDIR:${TMPDIR:=/tmp}:
d=$TMPDIR/test-rvm-pwd-hook
mkdir -p $d/.rvm/hooks
f="$d/.rvm/hooks/after_cd_test install.sh"
echo "echo test it" > "$f"
echo "echo spaces" > $d/.rvm/hooks/after_cd_test
echo "echo install" > $d/install.sh
chmod +x "$f" $d/.rvm/hooks/after_cd_test $d/install.sh

: test trusted
rvm rvmrc trust "$f"
cd $d
# match=/^test it$/
# match!=/^spaces$/
# match!=/^install$/
# status=0

: cleanup
rvm rvmrc reset $f
rm -rf $d