-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·29 lines (22 loc) · 973 Bytes
/
setup.sh
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
#!/usr/bin/env /bin/sh
# Terminate early on pipeline failure, since we use pipes below
set -e
# Create a reusable filter chain
RELEASE_FILTER="(.[0] | (select(.draft == false) | select(.prerelease == false)).assets[] | \
select(.name | contains(\"x86_64-unknown-linux-gnu\"))).browser_download_url"
# Retrieve the latest stable release of Zola from GitHub
ZOLA_URL=$(curl -sS -H 'Accept: application/json' \
https://api.github.com/repos/getzola/zola/releases | \
jq -r "$RELEASE_FILTER"
)
S3UTIL_URL=$(curl -sS -H 'Accept: application/json' \
https://api.github.com/repos/ryankurte/s3-util/releases | \
jq -r "$RELEASE_FILTER"
)
# Make a directory at $HOME/bin to contain downloaded binaries
mkdir -p $HOME/.local/bin
# Download binaries for Zola and S3 Util, extracting the archive contents to $HOME/bin
curl -sSL $ZOLA_URL | tar -xzf - -C $HOME/.local/bin
curl -sSL $S3UTIL_URL | tar -xzf - -C $HOME/.local/bin
# Install npm dependencies
npm ci