Add basic bootstrap routine
This commit is contained in:
parent
ed040d9caa
commit
7e0d5440d8
4 changed files with 86 additions and 23 deletions
66
install.sh
Executable file
66
install.sh
Executable file
|
|
@ -0,0 +1,66 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# install.sh
|
||||
#
|
||||
# Installs dotfiles and packages for my setup
|
||||
#
|
||||
# Will first install yay, then all my used packages (read from bootstrap/packages.csv)
|
||||
#
|
||||
# Will symlink all my dotfiles into their correct places using autostow.sh
|
||||
|
||||
main() {
|
||||
local cmd=""
|
||||
local ret=0
|
||||
|
||||
case "$1" in
|
||||
-v | --version)
|
||||
printf "Personal system bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1\n"
|
||||
;;
|
||||
-h | --help)
|
||||
printf "Usage: install [-f|--force][-v|--version][-h|--help]\n\n-f Do not ask for any confirmations but force update and installation.\n"
|
||||
;;
|
||||
-f | --force)
|
||||
install true
|
||||
;;
|
||||
*)
|
||||
install false
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
|
||||
$cmd "$@"
|
||||
ret=$((ret + $?))
|
||||
exit $ret
|
||||
}
|
||||
|
||||
check_consent() {
|
||||
echo "This will take a while, install many packages and link dotfiles all over the place. Proceed [y/N]?"
|
||||
read -r yes
|
||||
if [[ "$yes" != y* ]]; then
|
||||
echo "Exiting."
|
||||
exit
|
||||
fi
|
||||
}
|
||||
|
||||
install() {
|
||||
unattended=$1
|
||||
if ! "$unattended"; then
|
||||
check_consent
|
||||
fi
|
||||
echo "====================== BEGINNING INSTALLATION ============================="
|
||||
if ! "$unattended"; then
|
||||
export BOOTSTRAP_PACKAGES="bootstrap/.config/bootstrap/packages.csv"
|
||||
./bootstrap/.config/bootstrap/install_packages.sh
|
||||
else
|
||||
export BOOTSTRAP_PACKAGES="bootstrap/.config/bootstrap/packages.csv"
|
||||
./bootstrap/.config/bootstrap/install_packages.sh -f
|
||||
fi
|
||||
|
||||
echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
|
||||
./bootstrap/.config/bootstrap/autostow.sh -s
|
||||
|
||||
echo "====================== INSTALLATION FINISHED =============================="
|
||||
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue