mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
fix: always remove cloned repo after run
This commit is contained in:
5
index.sh
5
index.sh
@@ -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!"
|
||||||
|
|||||||
Reference in New Issue
Block a user