From 7ee8a18a9770b581b871c0f5c36f248985ced22b Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Wed, 9 Oct 2019 23:22:15 +0200 Subject: [PATCH] :wrench: Update gwion-pkg --- scripts/gwion-pkg | 49 ++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/scripts/gwion-pkg b/scripts/gwion-pkg index a8033996..3670c374 100644 --- a/scripts/gwion-pkg +++ b/scripts/gwion-pkg @@ -35,37 +35,42 @@ install_manifest() { do [ -d $DIR ] || continue PLUG=$DIR/$(basename $1 .manifest).so - if [ -f $PLUG ] - then - install_plug "$1" "$PLUG" $2 - return - fi + [ -f $PLUG ] || make + install_plug "$1" "$PLUG" $2 done } +read_all_manifests() { + for FILE in *.manifest + do read_manifest $FILE + done +} + +get_max() { + MAX=0 + for i in "${!magic_variable[@]}" + do [ "${magic_variable[$i]}" -gt "$MAX" ] && MAX="${magic_variable[$i]}" + done +} + +install_all_manifests() { + for i in "${!magic_variable[@]}" + do install_manifest "$i" $(( MAX - ${magic_variable[$i]})) + done + fi +} + if [ "$1" = "list" ] -then # clear +then [ -d .gwion-pkg ] && ls .gwion-pkg | sort -u | cut -d_ -f 2 elif [ "$1" = "run" ] then # run shift - gwion -p .gwion-pkg $@ + gwion -c .gwion-pkg/gwion.cfg -p .gwion-pkg $@ elif [ "$1" = "clear" ] then rm -rf .gwion-pkg -else -for FILE in *.manifest -do read_manifest $FILE -done - -MAX=0 -for i in "${!magic_variable[@]}" -do [ "${magic_variable[$i]}" -gt "$MAX" ] && MAX="${magic_variable[$i]}" -done - - -for i in "${!magic_variable[@]}" -do - install_manifest "$i" $(( MAX - ${magic_variable[$i]})) -done fi +read_all_manifests +get_max +install_all_manifests -- 2.43.0