updater.sh: -n overrides -o

This commit is contained in:
overdodactyl 2018-11-21 12:57:08 -07:00
parent 4e8291d2c7
commit 36192205a3

View file

@ -2,7 +2,7 @@
## ghacks-user.js updater for macOS and Linux ## ghacks-user.js updater for macOS and Linux
## version: 1.6 ## version: 2.0
## Author: Pat Johnson (@overdodactyl) ## Author: Pat Johnson (@overdodactyl)
## Additional contributors: @earthlng, @ema-pe ## Additional contributors: @earthlng, @ema-pe
@ -75,6 +75,7 @@ CONFIRM="yes"
OVERRIDE="user-overrides.js" OVERRIDE="user-overrides.js"
BACKUP="multiple" BACKUP="multiple"
COMPARE=false COMPARE=false
SKIPOVERRIDE=false
if [ $# != 0 ]; then if [ $# != 0 ]; then
legacy_lc="$(echo $1 | tr '[A-Z]' '[a-z]')" legacy_lc="$(echo $1 | tr '[A-Z]' '[a-z]')"
@ -103,7 +104,7 @@ if [ $# != 0 ]; then
CONFIRM="no" CONFIRM="no"
;; ;;
n) n)
OVERRIDE="none" SKIPOVERRIDE=true
;; ;;
o) o)
OVERRIDE=${OPTARG} OVERRIDE=${OPTARG}
@ -309,11 +310,12 @@ update_userjs () {
cp user.js userjs_diffs/past_user.js cp user.js userjs_diffs/past_user.js
fi fi
backup_file user.js backup_file user.js
if [ "$OVERRIDE" != "none" ]; then if [ "$SKIPOVERRIDE" = true ]; then
while IFS=',' read -ra FILE; do return 0
add_override "$FILE"
done <<< "$OVERRIDE"
fi fi
while IFS=',' read -ra FILE; do
add_override "$FILE"
done <<< "$OVERRIDE"
} }
remove_comments () { remove_comments () {