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"
|
echo -e "\033[0;32mBash-it template has been added to your $CONFIG_FILE\033[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
function modify_config_files() {
|
function check_for_backup() {
|
||||||
if ! [[ $silent ]]; then
|
|
||||||
if [ -e "$HOME/$BACKUP_FILE" ]; then
|
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
|
echo -e "\033[0;33mBackup file already exists. Make sure to backup your .bashrc before running this installation.\033[0m" >&2
|
||||||
while ! [[ $silent ]]; do
|
while ! [[ $silent ]]; do
|
||||||
|
|
@ -96,6 +95,11 @@ function modify_config_files() {
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function modify_config_files() {
|
||||||
|
if ! [[ $silent ]]; then
|
||||||
|
check_for_backup
|
||||||
|
|
||||||
while ! [[ $append_to_config ]]; do
|
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
|
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