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>
This commit is contained in:
Coenraad Loubser
2024-11-19 01:09:10 +02:00
committed by GitHub
parent 8fccf2eed3
commit 865e3c056d

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