removed certain checks that are now handled by run()

This commit is contained in:
pyr0ball 2023-06-09 16:03:21 -07:00
parent 3e62dc51cd
commit 2ac709f93c

View file

@ -203,7 +203,7 @@ install-functions(){
take-backup(){ take-backup(){
name="$1" name="$1"
if [[ $update_run != true ]] ; then # if [[ $update_run != true ]] ; then
# Check if a backup file or symbolic link already exists # Check if a backup file or symbolic link already exists
if [[ -e "$name.bak" || -L "$name.bak" ]]; then if [[ -e "$name.bak" || -L "$name.bak" ]]; then
run boxline " $name.bak backup already exists" run boxline " $name.bak backup already exists"
@ -219,11 +219,11 @@ take-backup(){
# Copy the file to the backup file with preservation of file attributes # Copy the file to the backup file with preservation of file attributes
run cp -p "$name" "$backup_name" run cp -p "$name" "$backup_name"
# Add the original file to the list of backup files # Add the original file to the list of backup files
backup_files+=("$name") run boxline " $name.bak backup already exists"
# Log the original file name to the backup file list file # Log the original file name to the backup file list file
run echo "$name" >> "$rundir/backup_files.list" run echo "$name" >> "$rundir/backup_files.list"
fi fi
fi # fi
} }
restore-backup(){ restore-backup(){
@ -232,7 +232,7 @@ restore-backup(){
run cp "$file".bak $file run cp "$file".bak $file
run echo "$file is restored" run echo "$file is restored"
done done
backup_files=() run boxline " $name.bak backup already exists"
if [ -f $rundir/backup_files.list ] ; then if [ -f $rundir/backup_files.list ] ; then
run rm $rundir/backup_files.list run rm $rundir/backup_files.list
fi fi
@ -306,13 +306,13 @@ install-extras(){
for extra in "${_extras[@]}"; do for extra in "${_extras[@]}"; do
# If the selected user is set to true # If the selected user is set to true
if [[ "${result[idx]}" == "true" ]] ; then if [[ "${result[idx]}" == "true" ]] ; then
if [[ $dry_run != true ]] ; then # if [[ $dry_run != true ]] ; then
run "${escape_dir}/extras/$extra -i" run "${escape_dir}/extras/$extra -i"
else # else
dry_run=false # dry_run=false
run "${escape_dir}/extras/$extra -D" # run "${escape_dir}/extras/$extra -D"
dry_run=true # dry_run=true
fi # fi
fi fi
done done
} }
@ -350,11 +350,17 @@ userinstall(){
warn "Some of the utilities needed by this script are missing" warn "Some of the utilities needed by this script are missing"
boxlinelog "Missing utilities:" boxlinelog "Missing utilities:"
boxlinelog "${bins_missing[@]}" boxlinelog "${bins_missing[@]}"
boxlinelog "After this installer completes, run:" boxlinelog "Would you like to install them? (this will require root password)"
boxseparator utilsmissing_menu=(
echo -en "\n${lbl}sudo apt install -y ${bins_missing[@]}\n${dfl}" "$(boxline "${green_check} Yes")"
boxborder "Press 'Enter' key when ready to proceed" "$(boxline "${red_x} No")"
read proceed )
case `select_opt "${utilsmissing_menu[@]}"` in
0) boxlinelog "${grn}Installing dependencies...${dfl}"
install-deps
;;
1) warn "Dependent Utilities missing: $bins_missing" ;;
esac
fi fi
# Check for and parse the installed vim version # Check for and parse the installed vim version