1
0
mirror of https://github.com/nvm-sh/nvm.git synced 2025-10-12 20:17:28 +08:00
nvm/test/fast/Running "nvm uninstall" with incorrect file permissions fails nicely

15 lines
282 B
Bash
Executable File

#!/bin/sh
cd ../..
mkdir v0.0.1
mkdir src/node-v0.0.1
sudo touch v0.0.1/sudo
. ./nvm.sh
RETURN_MESSAGE="$(nvm uninstall v0.0.1 2>&1)"
CHECK_FOR="Cannot uninstall, incorrect permissions on installation folder"
test "${RETURN_MESSAGE#*$CHECK_FOR}" != "$RETURN_MESSAGE" || exit 1