30 lines
760 B
Bash
Executable File
30 lines
760 B
Bash
Executable File
#!/bin/zsh
|
|
# Script Version: 01
|
|
# Description: Pulls the latest gitea_push.sh from Gitea into ~/scripts and makes it executable
|
|
|
|
# Set variables
|
|
# ========
|
|
GITEA_RAW_URL="https://gitea.bubuit.net/oib/at2-scripts/raw/branch/main/gitea_push.sh"
|
|
LOCAL_DIR="$HOME/scripts"
|
|
LOCAL_PATH="$LOCAL_DIR/gitea_push.sh"
|
|
|
|
# Ensure scripts directory exists
|
|
# ========
|
|
if [ ! -d "$LOCAL_DIR" ]; then
|
|
echo "[INFO] Creating directory $LOCAL_DIR"
|
|
mkdir -p "$LOCAL_DIR"
|
|
fi
|
|
|
|
# Main Process
|
|
# ========
|
|
echo "[INFO] Downloading gitea_push.sh from Gitea"
|
|
curl -L "$GITEA_RAW_URL" -o "$LOCAL_PATH"
|
|
|
|
if [ $? -eq 0 ]; then
|
|
chmod +x "$LOCAL_PATH"
|
|
echo "[INFO] gitea_push.sh downloaded and made executable at $LOCAL_PATH"
|
|
else
|
|
echo "[ERROR] Failed to download gitea_push.sh"
|
|
fi
|
|
|