-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·40 lines (34 loc) · 847 Bytes
/
Copy pathsetup
File metadata and controls
executable file
·40 lines (34 loc) · 847 Bytes
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
set -euo pipefail
# Setup a brand new computer by dispatching to the OS-specific script
# under bin/setup/.
#
# Maintainer: asccigcc
#
# Usage:
# ./setup
# Run from the repo root so bin/setup/* resolves from any CWD.
cd "$(dirname "$0")"
detect_os() {
case "$(uname -s)" in
Darwin) echo "macos" ;;
Linux)
if grep -qi ubuntu /etc/os-release; then
echo "ubuntu"
elif grep -qi fedora /etc/os-release; then
echo "fedora"
else
echo "unknown"
fi
;;
*) echo "unknown" ;;
esac
}
os="$(detect_os)"
script="bin/setup/${os}"
if [[ "$os" == "unknown" || ! -f "$script" ]]; then
echo "Unsupported operating system: $(uname -s)"
exit 1
fi
echo "Running setup for ${os}"
bash "$script"