ref(classic): Do not 'rm -rf <unquoted variable>' when removing classic env (#8417)

Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
Co-authored-by: Toran Bruce Richards <toran.richards@gmail.com>
pull/8670/head^2
Coenraad Loubser 2024-11-19 01:09:10 +02:00 committed by GitHub
parent 8fccf2eed3
commit 865e3c056d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -2,8 +2,12 @@
ENV_PATH=$(poetry env info --path)
if [ -d "$ENV_PATH" ]; then
rm -rf $ENV_PATH
echo "Removed the poetry environment at $ENV_PATH."
if [ -e delete ]; then
rm -rf "$ENV_PATH" || { echo "Please manually remove $ENV_PATH"; exit 1; }
else
echo "Press ENTER to remove $ENV_PATH"
read && { rm -r "$ENV_PATH" && echo "Removed the poetry environment at $ENV_PATH."; } || { echo "Please manually remove $ENV_PATH."; exit 1; }
fi
else
echo "No poetry environment found."
fi