Skip to content

Commit 76a02dc

Browse files
authored
more fixes to the download script (#776)
1 parent 994be5a commit 76a02dc

File tree

2 files changed

+15
-28
lines changed

2 files changed

+15
-28
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ You can download and run the Parseable binary on your laptop.
6767
- Linux or MacOS
6868

6969
```bash
70-
curl https://raw.githubusercontent.com/parseablehq/parseable/main/scripts/download.sh | bash
70+
curl https://logg.ing/install | bash
7171
```
7272

7373
- Windows
7474

7575
```pwsh
76-
powershell -c "irm https://raw.githubusercontent.com/parseablehq/parseable/main/scripts/download.ps1 | iex"
76+
powershell -c "irm https://logg.ing/install-windows | iex"
7777
```
7878

7979
Once this runs successfully, you'll see dashboard at [http://localhost:8000 ↗︎](http://localhost:8000). You can login to the dashboard default credentials `admin`, `admin`.

scripts/download.sh

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,13 @@
33
# supported CPU architectures and operating systems
44
SUPPORTED_ARCH=("x86_64" "arm64")
55
SUPPORTED_OS=("linux" "darwin")
6-
# Associate binaries with CPU architectures and operating systems
7-
declare -A BINARIES=(
8-
["x86_64-linux"]="Parseable_x86_64-unknown-linux-gnu"
9-
["arm64-linux"]="Parseable_aarch64-unknown-linux-gnu"
10-
["x86_64-darwin"]="Parseable_x86_64-apple-darwin"
11-
["arm64-darwin"]="Parseable_aarch64-apple-darwin"
12-
)
6+
DOWNLOAD_BASE_URL="parseable.gateway.scarf.sh/"
7+
138
# Get the system's CPU architecture and operating system
149
CPU_ARCH=$(uname -m)
1510
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
1611

12+
printf "\n=========================\n"
1713
printf "Detected CPU architecture: %s\n" "$CPU_ARCH"
1814
printf "Detected operating system: %s\n" "$OS"
1915

@@ -34,38 +30,29 @@ if ! echo "${SUPPORTED_OS[@]}" | grep -q "\\b${OS}\\b"; then
3430
echo "Error: Unsupported operating system (${OS})."
3531
exit 1
3632
fi
33+
3734
# Get the latest release information using GitHub API
3835
release=$(curl -s "https://api.github.com/repos/parseablehq/parseable/releases/latest")
36+
# find the release tag
37+
release_tag=$(echo "$release" | grep -o "\"tag_name\":\s*\"[^\"]*\"" | cut -d '"' -f 4)
38+
printf "Found latest release version: $release_tag\n"
3939

40-
printf "Fetching release information for parseable...\n"
41-
42-
# Loop through binaries in the release and find the appropriate one
43-
for arch_os in "${CPU_ARCH}-${OS}"; do
44-
binary_name="${BINARIES[$arch_os]}"
45-
download_url=$(echo "$release" | grep -o "\"browser_download_url\":\s*\"[^\"]*${binary_name}\"" | cut -d '"' -f 4)
46-
if [ -n "$download_url" ]; then
47-
break
48-
fi
49-
done
40+
download_url=${DOWNLOAD_BASE_URL}${CPU_ARCH}-${OS}.${release_tag}
5041

51-
printf "Checking for existing installation...\n"
5242
if [[ -d ${INSTALL_DIR} ]]; then
5343
printf "A Previous version of parseable already exists. Run 'parseable --version' to check the version."
54-
printf "or consider removing that before Installing"
44+
printf "or consider removing that before new installation\n"
5545
exit 1
56-
5746
else
58-
printf "No Previous installation found\n"
59-
printf "Installing parseable...\n"
6047
mkdir -p ${BIN_DIR}
6148
fi
6249

63-
6450
# Download the binary using curl or wget
51+
printf "Downloading Parseable version $release_tag, for OS: $OS, CPU architecture: $CPU_ARCH\n\n"
6552
if command -v curl &>/dev/null; then
66-
curl -L -o "${BIN_NAME}" "$download_url" 2&>> /dev/null
53+
curl -L -o "${BIN_NAME}" "$download_url"
6754
elif command -v wget &>/dev/null; then
68-
wget -O "${BIN_NAME}" "$download_url" 2&>> /dev/null
55+
wget -O "${BIN_NAME}" "$download_url"
6956
else
7057
echo "Error: Neither curl nor wget found. Please install either curl or wget."
7158
exit 1
@@ -79,4 +66,4 @@ printf "Adding parseable to the path\n"
7966
PATH_STR="export PATH=${BIN_DIR}"':$PATH'
8067
echo ${PATH_STR} >> ${RC_FILE_PATH}
8168

82-
echo "parseable was added to the path. Please refresh the environment by sourcing the ${RC_PATH}"
69+
echo "parseable was added to the path. Please refresh the environment by sourcing the ${RC_FILE_PATH}"

0 commit comments

Comments
 (0)