Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions scripts/download-webui.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
#!/usr/bin/env bash

set -e

# Check if required tools (jq and curl) are installed
for tool in curl jq; do
if ! command -v $tool &> /dev/null; then
echo "Error: $tool is not installed."
exit 1
fi
done

OUTDIR=$(dirname $0)/../resources/webui/

echo "⇣ Downloading webui dist to $OUTDIR ⇣"
Expand All @@ -10,4 +20,9 @@ mkdir -p $OUTDIR
url=$(curl -s https://api.github.com/repos/filecoin-saturn/node-webui/releases/latest | \
jq -r '.assets[] | select(.name|match("saturn-webui.tar.gz$")) | .browser_download_url')

if [ -z "$url" ]; then
echo "Error: Could not find the release URL."
exit 1
fi

curl -L $url | tar -zx -C $OUTDIR