26 lines
913 B
Bash
Executable file
26 lines
913 B
Bash
Executable file
#!/usr/bin/env bash
|
|
REPO="qishibo/AnotherRedisDesktopManager"
|
|
BINARY_NAME="redis"
|
|
TARGET_DIR="$HOME/.local/bin"
|
|
BINARY_PATH="$TARGET_DIR/$BINARY_NAME"
|
|
|
|
if [ ! -x "$BINARY_PATH" ]; then
|
|
notify-send "📦 Installing $BINARY_NAME" "Downloading from GitHub repository $REPO..."
|
|
|
|
mkdir -p "$TARGET_DIR"
|
|
|
|
arch=$(uname -m)
|
|
filename=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.assets[].name' | grep "AppImage" | grep "$arch")
|
|
fileurl=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r --arg filename "$filename" '.assets[] | select(.name == $filename) | .browser_download_url')
|
|
|
|
wget -q -O "$BINARY_PATH" "$fileurl" || {
|
|
notify-send -u critical "Installation Failed" "Failed to download $BINARY_NAME from $REPO"
|
|
exit 1
|
|
}
|
|
|
|
chmod +x "$BINARY_PATH"
|
|
|
|
notify-send "Installation Complete" "$BINARY_NAME has been installed successfully"
|
|
fi
|
|
|
|
exec "$BINARY_PATH" "$@"
|