Skip to content

Commit

Permalink
final tests passed prior to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
b02860de585071a2 committed Oct 8, 2023
1 parent f59a077 commit 4ebcef4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 11 additions & 12 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,6 @@ fi

clear

# Allow the user to exclude specific files
if [ ! -v exclusions ] && [ "$export_method" = "tar" ]; then
cecho "You may optionally choose to exclude certain directories and/or files from being backed up."
cecho "Press Enter to continue."
wait_for_enter

excluded_files=( 'no' 'yes' )
select_option_from_list "Do you wish to add any exclusions?" excluded_files[@] exclusions
fi

clear

if [ ! -v use_hooks ]; then
cecho "Would you like to use hooks?"
cecho "Choose 'no' if you don't understand this question, or don't want to load hooks."
Expand All @@ -120,7 +108,18 @@ elif [ "$use_hooks" = "yes" ]; then
exit 1
fi

# Allow the user to exclude specific files
# Leaving this block after the hooks integration, as we do not know if the user wants their hooks to operate on only the chosen files or not.
if [ ! -v exclusions ] && [ "$export_method" = "tar" ]; then
cecho "You may optionally choose to exclude certain directories and/or files from being backed up."
cecho "Press Enter to continue."
wait_for_enter

excluded_files=( 'no' 'yes' )
select_option_from_list "Do you wish to add any exclusions?" excluded_files[@] exclusions
fi

clear

if command -v srm &> /dev/null
then
Expand Down
2 changes: 0 additions & 2 deletions functions/backup_func.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ function backup_func() {
# Receive user input
# TODO: this could be much less flaky by utilizing 'toybox vi' to edit the exclusions list. Ignoring for now.
adb shell printf "Exclusions:\ " && IFS= read -r exclusions_response
# sh will throw an error if this dir does not exist. This line can probably be removed.
# adb shell [ -d "/storage/emulated/0/open-android-backup-temp" ] || mkdir -p /storage/emulated/0/open-android-backup-temp
# This command MUST be contained in double quotes, or else adb shell chokes on the input and our 'tar -x' fails.
adb shell "echo "$exclusions_response" | sed 's/ /\n/g' > /storage/emulated/0/open-android-backup-temp/exclusions.txt"
cecho "Exporting internal storage - this will take a while."
Expand Down

0 comments on commit 4ebcef4

Please sign in to comment.