31 lines
868 B
Bash
Executable File
31 lines
868 B
Bash
Executable File
#!/bin/bash
|
|
|
|
ROOTDIR=$(cd "$(dirname "$0")" && pwd)
|
|
|
|
confirm() {
|
|
local prompt="$1 [Y/n] "
|
|
|
|
while true; do
|
|
read -e -p "$prompt" yn
|
|
case "$yn" in
|
|
"" ) return 0;; # default is yes
|
|
[Yy]* ) return 0;;
|
|
[Nn]* ) return 1;;
|
|
* ) ;; # wait for yes or no
|
|
esac
|
|
done
|
|
}
|
|
|
|
# Install tools
|
|
if [[ "$OSTYPE" == linux-gnu* ]]; then
|
|
confirm "Install Nix" && "$ROOTDIR/install/install-nix.sh"
|
|
confirm "Install Nix packages" && "$ROOTDIR/install/install-nix-packages.sh"
|
|
elif [[ "$OSTYPE" == darwin* ]]; then
|
|
confirm "Install Homebrew" && "$ROOTDIR/install/install-brew.sh"
|
|
confirm "Install Homebrew packages" && "$ROOTDIR/install/install-brew-packages.sh"
|
|
fi
|
|
|
|
# Extra steps
|
|
confirm "Install symlinks" && "$ROOTDIR/install/install-symlinks.sh"
|
|
confirm "Install login shell" && "$ROOTDIR/install/install-shell.sh"
|