-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·40 lines (34 loc) · 1.1 KB
/
install.sh
File metadata and controls
executable file
·40 lines (34 loc) · 1.1 KB
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
38
39
40
#!/usr/bin/env bash
# kos-kit prereq installer
# Installs the minimum toolchain needed to run `kos setup`, then hands off.
set -euo pipefail
os="$(uname)"
install_prereqs_macos() {
if ! command -v brew >/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
brew install mise chezmoi bun gum
}
install_prereqs_linux() {
command -v mise >/dev/null || curl -fsSL https://mise.run | sh
command -v chezmoi >/dev/null || sh -c "$(curl -fsLS get.chezmoi.io)"
command -v bun >/dev/null || curl -fsSL https://bun.sh/install | bash
if ! command -v gum >/dev/null; then
echo "gum is required but not installed."
echo "Install via: https://github.com/charmbracelet/gum#installation"
exit 1
fi
}
case "$os" in
Darwin) install_prereqs_macos ;;
Linux) install_prereqs_linux ;;
*) echo "Unsupported OS: $os"; exit 1 ;;
esac
: "${KOS_DIR:=$HOME/.kos-kit}"
if [ ! -d "$KOS_DIR" ]; then
git clone https://github.com/kyrelldixon/kos-kit.git "$KOS_DIR"
fi
cd "$KOS_DIR"
bun install
(cd cli && bun link)
exec kos setup "$@"