Non-interactive setup

This commit is contained in:
Daniel Flanagan 2019-03-29 13:30:15 -05:00
parent 5729004665
commit d6cdb0f582

14
setup
View file

@ -2,6 +2,17 @@
# TODO: ascii art header # TODO: ascii art header
INTERACTIVE=1
while test $# -gt 0; do
case "$1" in
-x|--non-interactive)
INTERACTIVE=0
shift
;;
esac
done
dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd) dfp=$(cd "$(dirname "${BASH_SOURCE[0]}" )/" && pwd)
source "${dfp}/scripts/setup_helpers.bash" source "${dfp}/scripts/setup_helpers.bash"
@ -83,8 +94,10 @@ links=(
"$dfp/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs" "$dfp/shell/user-dirs" "$XDG_CONFIG_HOME/user-dirs.dirs"
) )
# TODO: pass interactive?
_dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}" _dotfiles_setup_run_setup "$dfp/.agreed-to-erasing-files.lock" "${links[@]}"
if [[ "$INTERACTIVE" = 1 ]]; then
echo -n -e "Do you want to run the sudo_setup script for changes to /etc" echo -n -e "Do you want to run the sudo_setup script for changes to /etc"
echo -n -e "\nand other root directories?" echo -n -e "\nand other root directories?"
read -r -p " [y/N] " response read -r -p " [y/N] " response
@ -95,3 +108,4 @@ fi
echo -e "Dotfiles Installed! Running 'exec bash'...\n" echo -e "Dotfiles Installed! Running 'exec bash'...\n"
exec bash exec bash
fi