+#!/bin/bash
+
: "${GWION_PLUG_PATH:=$PWD}"
+
+help() {
+prg=$(basename $0)
+echo "Usage:
+
+ $prg install - install dependancies
+ $prg clear - clear dependancies
+ $prg run - run package
+ $prg help - this help
+
+---
+requires GWION_PLUG_PATH environment variable"
+}
+
declare -A magic_variable=()
read_manifest() {
for i in "${!magic_variable[@]}"
do install_manifest "$i" $(( MAX - ${magic_variable[$i]}))
done
- fi
}
-if [ "$1" = "list" ]
-then
+list_package() {
[ -d .gwion-pkg ] && ls .gwion-pkg | sort -u | cut -d_ -f 2
-elif [ "$1" = "run" ]
-then # run
+}
+
+
+run_package() {
shift
gwion -c .gwion-pkg/gwion.cfg -p .gwion-pkg $@
+}
+
+clear_package() {
+ rm -rf .gwion-pkg
+}
+
+install_package() {
+ read_all_manifests
+ get_max
+ install_all_manifests
+}
+
+if [ "$1" = "list" ]
+then list_package
+elif [ "$1" = "run" ]
+then run_package $@
elif [ "$1" = "clear" ]
-then rm -rf .gwion-pkg
+then clear_package
+elif [ "$1" = "install" ]
+then install_package
+else help
fi
-read_all_manifests
-get_max
-install_all_manifests