Add run-local option to run with a thirdy-part plugin

This commit is contained in:
Francesco Abbate 2021-03-06 15:39:30 +01:00
parent 6909fd9a60
commit 913549a7b6
1 changed files with 17 additions and 0 deletions

View File

@ -2,9 +2,15 @@
set -o errexit
# accept argument in the form
github_raw_content () {
echo "https://raw.githubusercontent.com/$1"
}
option_portable=off
option_copy=on
pargs=()
plugins=()
while [[ "$#" -gt 0 ]]; do
case $1 in
-portable)
@ -13,6 +19,10 @@ while [[ "$#" -gt 0 ]]; do
-keep)
option_copy=off
;;
-plugin=*)
# should be like -plugin=franko/lite-plugins/master/plugins/autowrap.lua
plugins+=("$(github_raw_content "${1#-plugin=}")")
;;
-global)
option_global=on
;;
@ -81,8 +91,15 @@ run_lite () {
fi
}
fetch_plugins () {
for name in "$@"; do
curl --insecure -L "$name" -o "$datadir/plugins/${name##*/}"
done
}
if [ $option_copy == on ]; then
build_lite
copy_lite_build
fi
fetch_plugins "${plugins[@]}"
run_lite