-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_toolkit.sh
More file actions
executable file
·33 lines (27 loc) · 982 Bytes
/
update_toolkit.sh
File metadata and controls
executable file
·33 lines (27 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# ============================================================
# Toolkit Updater
# Author: Your Name
# Description: Pulls the latest changes from GitHub
# ============================================================
TOOLKIT_DIR="$(dirname "$0")/.."
REMOTE_NAME="origin"
BRANCH_NAME="main"
echo "============================"
echo " Toolkit Auto-Updater"
echo "============================"
if [ ! -d "$TOOLKIT_DIR/.git" ]; then
echo "[Error] This folder is not a Git repository."
echo "Clone it from GitHub first:"
echo " git clone https://github.com/YOUR_USERNAME/bash-toolkit.git"
exit 1
fi
echo "[Info] Fetching latest updates..."
git -C "$TOOLKIT_DIR" fetch "$REMOTE_NAME"
echo "[Info] Pulling from $REMOTE_NAME/$BRANCH_NAME..."
git -C "$TOOLKIT_DIR" pull "$REMOTE_NAME" "$BRANCH_NAME"
if [ $? -eq 0 ]; then
echo "[Success] Toolkit updated successfully!"
else
echo "[Error] Update failed. Please check your Git configuration."
fi