install: Move backup check into a separate function
parent
ef10bcd151
commit
9e37f0d09e
|
|
@ -76,8 +76,7 @@ function backup_append() {
|
|||
echo -e "\033[0;32mBash-it template has been added to your $CONFIG_FILE\033[0m"
|
||||
}
|
||||
|
||||
function modify_config_files() {
|
||||
if ! [[ $silent ]]; then
|
||||
function check_for_backup() {
|
||||
if [ -e "$HOME/$BACKUP_FILE" ]; then
|
||||
echo -e "\033[0;33mBackup file already exists. Make sure to backup your .bashrc before running this installation.\033[0m" >&2
|
||||
while ! [[ $silent ]]; do
|
||||
|
|
@ -96,6 +95,11 @@ function modify_config_files() {
|
|||
esac
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
function modify_config_files() {
|
||||
if ! [[ $silent ]]; then
|
||||
check_for_backup
|
||||
|
||||
while ! [[ $append_to_config ]]; do
|
||||
read -e -n 1 -r -p "Would you like to keep your $CONFIG_FILE and append bash-it templates at the end? [y/N] " choice
|
||||
|
|
|
|||
Loading…
Reference in New Issue