forked from silverbulletmd/silverbullet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
35 lines (28 loc) · 978 Bytes
/
install.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
30
31
32
33
34
35
#!/bin/sh
set -e
if ! command -v unzip >/dev/null; then
echo "Error: unzip is required to install SilverBullet." 1>&2
exit 1
fi
case $(uname -sm) in
"Darwin x86_64") target="darwin-x86_64" ;;
"Darwin arm64") target="darwin-aarch64" ;;
"Linux aarch64")
echo "Error: Official SilverBullet builds for Linux aarch64 are not available." 1>&2
exit 1
;;
*) target="linux-x86_64" ;;
esac
echo "Installing for $target"
if [ $# -eq 0 ]; then
sb_uri="https://github.com/silverbulletmd/silverbullet/releases/latest/download/silverbullet-server-${target}.zip"
else
sb_uri="https://github.com/silverbulletmd/silverbullet/releases/download/${1}/silverbullet-server-${target}.zip"
fi
exe=silverbullet
bin_dir=.
curl --fail --location --progress-bar --output "$exe.zip" "$sb_uri"
unzip -d "$bin_dir" -o "$exe.zip"
chmod +x "$exe"
rm "$exe.zip"
echo "SilverBullet server was installed successfully to $bin, run it directly via ./$exe or move it to a more convenient place."