File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Install wild-linker official binaries from GitHub Releases.
4+
5+ set -euo pipefail
6+
7+ WILD_VERSION=" ${WILD_VERSION:- ${1:- 0.5.0} } "
8+ if [ " $( uname -s) " != " Linux" ]; then
9+ echo " Error: This script is intended for Linux systems only."
10+ exit 1
11+ elif [ -z " $WILD_VERSION " ]; then
12+ echo " Usage: $0 [version]"
13+ exit 1
14+ elif [ -e /usr/local/bin/wild ] && /usr/local/bin/wild --version | grep -Fq " $WILD_VERSION " ; then
15+ echo " Warning: existing wild $WILD_VERSION found at /usr/local/bin/wild. Skipping installation."
16+ exit 0
17+ fi
18+
19+ if [ " $( whoami) " = root ]; then SUDO=; else SUDO=" $( command -v sudo || command -v doas || true) " ; fi
20+
21+ ARCH=" $( uname -m) "
22+ WILD_REPO=" ${WILD_REPO:- https:// github.com/ davidlattimore/ wild} "
23+ WILD_PACKAGE=" wild-linker-${ARCH} -unknown-linux-gnu"
24+ WILD_URL=" ${WILD_URL:- $WILD_REPO } /releases/download/$WILD_VERSION /${WILD_PACKAGE} .tar.xz"
25+
26+ echo " Downloading from $WILD_URL "
27+ curl -fsSL --output - " $WILD_URL " \
28+ | $SUDO tar -C /usr/local/bin --strip-components=1 --no-overwrite-dir -xJf - \
29+ " wild-linker-${ARCH} -unknown-linux-gnu/wild"
You can’t perform that action at this time.
0 commit comments