HEX
Server: nginx/1.24.0
System: Linux nowruzgan 6.8.0-57-generic #59-Ubuntu SMP PREEMPT_DYNAMIC Sat Mar 15 17:40:59 UTC 2025 x86_64
User: babak (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: //opt/nvm/test/fast/Running 'nvm uninstall' with incorrect file permissions fails nicely
#!/bin/sh

set -ex

\. ../../nvm.sh
\. ../common.sh

make_fake_node v0.0.1
sudo touch ""$(nvm_version_path v0.0.1)"/sudo"

RETURN_MESSAGE="$(nvm uninstall v0.0.1 2>&1 || echo)"
CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder"

[ "${RETURN_MESSAGE#*$CHECK_FOR}" != "$RETURN_MESSAGE" ] || exit 1