fix: always remove cloned repo after run

This commit is contained in:
2026-02-13 05:29:13 -03:00
parent 896cad8234
commit e9b6b30c02

View File

@@ -9,6 +9,8 @@ if [ -z "$ADMIN_USER" ]; then
exit 1 exit 1
fi fi
trap 'cd / && rm -rf "$TARGET_DIR"' EXIT
if [ ! -d "$TARGET_DIR" ]; then if [ ! -d "$TARGET_DIR" ]; then
echo "Cloning the repository..." echo "Cloning the repository..."
git clone "$REPO_URL" "$TARGET_DIR" git clone "$REPO_URL" "$TARGET_DIR"
@@ -23,7 +25,4 @@ chmod +x ./install.sh
echo "[ INITIALIZER ]: Setup completed succesfully!" echo "[ INITIALIZER ]: Setup completed succesfully!"
echo "[ INITIALIZER ]: Cleaning up"
cd /
rm -rf "$TARGET_DIR"
echo "[ INITIALIZER ]: Success!" echo "[ INITIALIZER ]: Success!"