-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·37 lines (29 loc) · 874 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
·37 lines (29 loc) · 874 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
34
35
36
37
#!/bin/bash
set -e
APP_NAME='GitLabBar'
APP_PATH="/Applications/${APP_NAME}.app"
REPO='yoanbernabeu/GitLabBar'
TMP_ZIP="/tmp/${APP_NAME}.zip"
echo "==> Fetching latest release..."
DOWNLOAD_URL=$(curl -sL "https://api.github.com/repos/${REPO}/releases/latest" | grep darwin-arm64 | grep -o 'https://.*\.zip')
if [ -z "$DOWNLOAD_URL" ]; then
echo "Error: could not find download URL."
exit 1
fi
if [ -d "$APP_PATH" ]; then
echo "==> Stopping ${APP_NAME}..."
killall "$APP_NAME" 2>/dev/null || true
sleep 1
echo "==> Removing previous version..."
rm -rf "$APP_PATH"
fi
echo "==> Downloading ${APP_NAME}..."
curl -#L -o "$TMP_ZIP" "$DOWNLOAD_URL"
echo "==> Installing to /Applications..."
unzip -qo "$TMP_ZIP" -d /Applications
xattr -cr "$APP_PATH"
rm -f "$TMP_ZIP"
echo "==> Launching ${APP_NAME}..."
open "$APP_PATH"
echo ""
echo "${APP_NAME} is ready!"