Add run-local option to run with a thirdy-part plugin
This commit is contained in:
parent
6909fd9a60
commit
913549a7b6
|
@ -2,9 +2,15 @@
|
||||||
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
|
||||||
|
# accept argument in the form
|
||||||
|
github_raw_content () {
|
||||||
|
echo "https://raw.githubusercontent.com/$1"
|
||||||
|
}
|
||||||
|
|
||||||
option_portable=off
|
option_portable=off
|
||||||
option_copy=on
|
option_copy=on
|
||||||
pargs=()
|
pargs=()
|
||||||
|
plugins=()
|
||||||
while [[ "$#" -gt 0 ]]; do
|
while [[ "$#" -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-portable)
|
-portable)
|
||||||
|
@ -13,6 +19,10 @@ while [[ "$#" -gt 0 ]]; do
|
||||||
-keep)
|
-keep)
|
||||||
option_copy=off
|
option_copy=off
|
||||||
;;
|
;;
|
||||||
|
-plugin=*)
|
||||||
|
# should be like -plugin=franko/lite-plugins/master/plugins/autowrap.lua
|
||||||
|
plugins+=("$(github_raw_content "${1#-plugin=}")")
|
||||||
|
;;
|
||||||
-global)
|
-global)
|
||||||
option_global=on
|
option_global=on
|
||||||
;;
|
;;
|
||||||
|
@ -81,8 +91,15 @@ run_lite () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fetch_plugins () {
|
||||||
|
for name in "$@"; do
|
||||||
|
curl --insecure -L "$name" -o "$datadir/plugins/${name##*/}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
if [ $option_copy == on ]; then
|
if [ $option_copy == on ]; then
|
||||||
build_lite
|
build_lite
|
||||||
copy_lite_build
|
copy_lite_build
|
||||||
fi
|
fi
|
||||||
|
fetch_plugins "${plugins[@]}"
|
||||||
run_lite
|
run_lite
|
||||||
|
|
Loading…
Reference in New Issue