Skip to content

Commit af04825

Browse files
committed
chore: update the installation script to handle dir creation bug
Signed-off-by: Sidharth Jawale <sidharth@obmondo.com>
1 parent 567339f commit af04825

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

install.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4+
PROJECT="linuxaid-cli"
5+
REPO="Obmondo/$PROJECT"
6+
API_URL="https://api.github.com/repos/$REPO/releases/latest"
7+
BIN_DIR="/usr/local/bin"
8+
BIN_NAME="linuxaid-install"
9+
410
function cleanup() {
511
rm -rf "$TMP_DIR"
612
exit 130
@@ -23,11 +29,6 @@ esac
2329
# -------------------------------------------------
2430
# 2. Find latest release tag on GitHub
2531
# -------------------------------------------------
26-
PROJECT=linuxaid-cli""
27-
REPO="Obmondo/$PROJECT"
28-
API_URL="https://api.github.com/repos/$REPO/releases/latest"
29-
30-
# Grab the tag name (e.g., v1.2.3)
3132
TAG=$(curl -sSf "$API_URL" | jq -r '.tag_name')
3233
if [[ -z "$TAG" ]]; then
3334
echo "Failed to obtain latest release tag" >&2
@@ -37,17 +38,13 @@ fi
3738
# -------------------------------------------------
3839
# 3. Build download URL for the appropriate asset
3940
# -------------------------------------------------
40-
# Expected asset name pattern: $PROJECT_${TAG}_linux_${TARGET}.tar.gz
4141
ASSET="${PROJECT}_${TAG}_linux_${TARGET}.tar.gz"
4242
DOWNLOAD_URL="https://github.com/$REPO/releases/download/$TAG/$ASSET"
4343
SOURCE_CHECKSUM=$(curl -sSf "https://api.github.com/repos/$REPO/releases/latest" | jq -r --arg url "$DOWNLOAD_URL" '.assets[] | select(.browser_download_url == $url) | .digest | split(":")[1]')
4444

4545
# -------------------------------------------------
4646
# 4. Download the package from Github
4747
# -------------------------------------------------
48-
BIN_DIR="/usr/local/bin"
49-
BIN_NAME="linuxaid-install"
50-
5148
# Trap SIGTERM (15), SIGINT (2 - Ctrl+C), and SIGHUP (1)
5249
trap cleanup SIGTERM SIGINT SIGHUP EXIT
5350

0 commit comments

Comments
 (0)