-
Notifications
You must be signed in to change notification settings - Fork 9
/
run
26 lines (20 loc) · 771 Bytes
/
run
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
#!/usr/bin/env bash
STRAP_RELEASE_REF="${STRAP_RELEASE_REF:-}"
[ -z "$STRAP_RELEASE_REF" ] && STRAP_RELEASE_REF='master'
export STRAP_RELEASE_REF # make available to the install script
STRAP_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/strapsh/strap/${STRAP_RELEASE_REF}/install"
if command -v wget >/dev/null; then
wget -qO- "$STRAP_INSTALL_SCRIPT_URL" | bash
elif command -v curl >/dev/null; then
curl -fsSL "$STRAP_INSTALL_SCRIPT_URL" | bash
else
echo "Neither wget nor curl are available. Cannot download strap." >&2
exit 1
fi
exepath=".strap/releases/current/bin/strap"
strapexe="$HOME/$exepath"
if [[ ! -x "$strapexe" ]]; then
echo "Strap installation likely failed: Could not find '\$HOME/$exepath'." >&2
exit 1
fi
"$strapexe" run "$@"