]> Nishi Git Mirror - gwion.git/commitdiff
:white_check_mark: Test unused tuple
authorfennecdjay <astor.jeremie@wanadoo.fr>
Wed, 9 Oct 2019 22:15:37 +0000 (00:15 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Wed, 9 Oct 2019 22:15:37 +0000 (00:15 +0200)
scripts/gwion-config [changed mode: 0755->0644]
scripts/gwion-pkg

old mode 100755 (executable)
new mode 100644 (file)
index 3670c374f49b09e5f3cf6e6a53b7e2d1efde4861..0840521e452fc9b29aa4c7214989e15b4a999474 100644 (file)
@@ -1,4 +1,20 @@
+#!/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() {
@@ -57,20 +73,36 @@ install_all_manifests() {
   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