mrrfv / open-android-backup

Back up your device without vendor lock-ins, using insecure software or root. Supports encryption and compression out of the box. Works cross-platform.
http://openandroidbackup.me/
GNU General Public License v3.0
674 stars 37 forks source link

Loading subscripts is suboptimal #67

Closed lemzwerg closed 1 year ago

lemzwerg commented 1 year ago

In backup.sh, the subscripts are loaded with

for f in "$DIR"/functions/*; do source "$f"; done

I think this is suboptimal. Let's assume that you make a change in helper.sh: On Unix, most editors create a backup file called helper.sh~. Due to the * in the above code, this backed-up file gets also loaded, and usually after the changed file, thus essentially cancelling any modifications.

A probably better way is to say

for f in "$DIR"/functions/*.sh; do source "$f"; done

instead.