@@ -58,6 +58,8 @@ ARROW='➜'
58
58
# WARNING='⚠'
59
59
# Repo name
60
60
REPO_NAME=" tmiland/invidious-installer"
61
+ # Invidious repo name
62
+ IN_REPO=${IN_REPO:- iv-org/ invidious}
61
63
# Set username
62
64
USER_NAME=invidious
63
65
# Set userdir
@@ -108,10 +110,13 @@ usage() {
108
110
printf " ${YELLOW} --help|-h${NORMAL} display this help and exit\\ n"
109
111
printf " ${YELLOW} --verbose|-v${NORMAL} increase verbosity\\ n"
110
112
printf " ${YELLOW} --banners|-b${NORMAL} disable banners\\ n"
113
+ printf " ${YELLOW} --repo|-r${NORMAL} select custom repo. E.G: user/invidious\\ n"
111
114
echo
112
115
}
113
116
114
- while [ $# != 0 ]; do
117
+ POSITIONAL_ARGS=()
118
+
119
+ while [[ $# -gt 0 ]]; do
115
120
case $1 in
116
121
--help | -h)
117
122
usage
@@ -125,18 +130,29 @@ while [ $# != 0 ]; do
125
130
shift
126
131
BANNERS=0
127
132
;;
133
+ --repo | -r) # Bash Space-Separated (e.g., --option argument)
134
+ IN_REPO=" $2 " # Source: https://stackoverflow.com/a/14203146
135
+ shift # past argument
136
+ shift # past value
137
+ ;;
128
138
--uninstall | -u)
129
139
shift
130
140
mode=" uninstall"
131
141
;;
132
- * )
142
+ - * |-- * )
133
143
printf " Unrecognized option: $1 \\ n\\ n"
134
144
usage
135
145
exit 1
136
146
;;
147
+ * )
148
+ POSITIONAL_ARGS+=(" $1 " ) # save positional arg
149
+ shift # past argument
150
+ ;;
137
151
esac
138
152
done
139
153
154
+ set -- " ${POSITIONAL_ARGS[@]} " # restore positional parameters
155
+
140
156
# Include functions
141
157
if [[ -f ./src/slib.sh ]]; then
142
158
. ./src/slib.sh
992
1008
(
993
1009
cd $USER_DIR >> " ${RUN_LOG} " 2>&1 || exit 1
994
1010
995
- log_debug " Downloading Invidious from GitHub "
1011
+ log_debug " Download Invidious from github.com/ ${IN_REPO} "
996
1012
run_ok " sudo -i -u invidious \
997
- git clone https://github.com/iv-org/invidious " " Cloning Invidious from GitHub "
1013
+ git clone https://github.com/${IN_REPO} " " Cloning Invidious from github.com/ ${IN_REPO} "
998
1014
cd - 1> /dev/null 2>&1 || exit 1
999
1015
)
1000
1016
fi
0 commit comments