forked from pressly/goose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·37 lines (28 loc) · 1 KB
/
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
36
37
#!/bin/sh
# Adapted from the Deno installer: Copyright 2019 the Deno authors. All rights reserved. MIT license.
# Ref: https://github.com/denoland/deno_install
# TODO(everyone): Keep this script simple and easily auditable.
# TODO(mf): this should work on Linux and macOS. Not intended for Windows.
set -e
os=$(uname -s | tr '[:upper:]' '[:lower:]')
arch=$(uname -m)
if [ "$arch" = "aarch64" ]; then
arch="arm64"
fi
if [ $# -eq 0 ]; then
goose_uri="https://github.com/pressly/goose/releases/latest/download/goose_${os}_${arch}"
else
goose_uri="https://github.com/pressly/goose/releases/download/${1}/goose_${os}_${arch}"
fi
goose_install="${GOOSE_INSTALL:-/usr/local}"
bin_dir="${goose_install}/bin"
exe="${bin_dir}/goose"
if [ ! -d "${bin_dir}" ]; then
mkdir -p "${bin_dir}"
fi
curl --silent --show-error --location --fail --location --output "${exe}" "$goose_uri"
chmod +x "${exe}"
echo "Goose was installed successfully to ${exe}"
if command -v goose >/dev/null; then
echo "Run 'goose --help' to get started"
fi