From 88d56060e8513fbff071142940c813464e1dc033 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 10 Oct 2019 00:15:37 +0200 Subject: [PATCH] :white_check_mark: Test unused tuple --- scripts/gwion-config | 0 scripts/gwion-pkg | 50 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 9 deletions(-) mode change 100755 => 100644 scripts/gwion-config diff --git a/scripts/gwion-config b/scripts/gwion-config old mode 100755 new mode 100644 diff --git a/scripts/gwion-pkg b/scripts/gwion-pkg index 3670c374..0840521e 100644 --- a/scripts/gwion-pkg +++ b/scripts/gwion-pkg @@ -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 -- 2.43.0