updater.sh - allow non-js files if passed to -o

This commit is contained in:
overdodactyl 2018-11-21 10:38:06 -07:00
parent 315bd08267
commit 1830a5037c

View file

@ -54,7 +54,7 @@ usage() {
echo -e "\t\t\t\t\t Ex: -o \"override folder\" "
echo -e "\t-n,\t\t Do not append any overrides, even if user-overrides.js exists."
echo -e
echo -e "Deprecated Arguments:"
echo -e "Deprecated Arguments (they still work for now):"
echo -e "\t-donotupdate,\t Use instead -d"
echo -e "\t-update,\t Use instead -u"
echo -e
@ -86,7 +86,7 @@ if [ $# != 0 ]; then
UPDATE="yes"
legacy_argument $1
else
while getopts ":hudso:nb" opt; do
while getopts ":hudsno:b" opt; do
case $opt in
h)
usage
@ -100,12 +100,12 @@ if [ $# != 0 ]; then
s)
CONFIRM="no"
;;
o)
OVERRIDE=${OPTARG}
;;
n)
OVERRIDE="none"
;;
o)
OVERRIDE=${OPTARG}
;;
b)
BACKUP="single"
;;
@ -277,15 +277,13 @@ get_userjs_version () {
add_override () {
input=$1
if [ -f "$input" ]; then
if [[ "$input" == *.js ]]; then
echo "" >> user.js
cat "$input" >> user.js
echo -e "Status: ${GREEN}Override file appended:${NC} ${input}"
fi
echo "" >> user.js
cat "$input" >> user.js
echo -e "Status: ${GREEN}Override file appended:${NC} ${input}"
elif [ -d "$input" ]; then
FSAVEIFS=$IFS
IFS=$(echo -en "\n\b") # Set IFS
FILES="${input}"/*
FILES="${input}"/*.js
for f in $FILES
do
add_override "$f"