Add central variable setting bootstrap directory

Prepare for moving bootstrap directory to conform to new ignore pattern
of autostow.sh script. Bootstrap directory can be overwritten through
environment variable BOOTSTRAP_DIRECTORY, however for now it still
rigidly requires the existence of an install_packages.sh file and an
autostow.sh file which it wants to execute.
This commit is contained in:
Marty Oehme 2020-01-30 13:09:10 +01:00
parent a3a1c4a5bd
commit b702158b7c
1 changed files with 6 additions and 4 deletions

View File

@ -8,13 +8,15 @@
#
# Will symlink all my dotfiles into their correct places using autostow.sh
bootstrap_dir="${BOOTSTRAP_DIRECTORY:-./bootstrap}"
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"
printf "Personal system bootstrap script.\n\n©Marty Oehme\n\nVersion: 0.1.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"
@ -50,15 +52,15 @@ install() {
echo "====================== BEGINNING INSTALLATION ============================="
if ! "$unattended"; then
export BOOTSTRAP_PACKAGES="bootstrap/packages.csv"
./bootstrap/install_packages.sh
"$bootstrap_dir"/install_packages.sh
else
export BOOTSTRAP_PACKAGES="bootstrap/packages.csv"
./bootstrap/install_packages.sh -f
"$bootstrap_dir"/install_packages.sh -f
fi
unset BOOTSTRAP_PACKAGES
echo "=================== BEGINNING DOTFILE MANAGEMENT =========================="
./bootstrap/autostow.sh -s
"$bootstrap_dir"/autostow.sh -s
echo "====================== INSTALLATION FINISHED =============================="