From c1f5eddb5ddcc33507485349fc1b5cc711def933 Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Mon, 12 Dec 2016 11:07:11 +0100 Subject: [PATCH] Repaired plugin reinstall --- lib/plugin.lib.sh | 6 ++++++ zaf | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/plugin.lib.sh b/lib/plugin.lib.sh index 3558e97..3f6ac7c 100644 --- a/lib/plugin.lib.sh +++ b/lib/plugin.lib.sh @@ -78,6 +78,12 @@ zaf_plugin_info() { echo } +# Get global plugin parameters +# $1 plugin +zaf_get_plugin_parameters() { + zaf_ctrl_get_global_option "${ZAF_PLUGINS_DIR}/${p}/control.zaf" "Parameters" | while read param rest; do echo $param; done +} + # Set plugin global parameter # $1 plugindir # $2 parameter diff --git a/zaf b/zaf index 026696c..6f298cc 100755 --- a/zaf +++ b/zaf @@ -239,8 +239,11 @@ reinstall) [ -z "$1" ] && echo "$0 reinstall plugin [plugin]..." for p in $@; do if zaf_is_plugin "$p"; then - (zaf_ctrl_get_global_option "${ZAF_PLUGINS_DIR}/${p}" "Parameters"; echo) | while read param; do + params=$(zaf_get_plugin_parameters) + zaf_wrn $params + for param in $params; do eval export ZAF_${p}_${param}=$(zaf_get_plugin_parameter "${ZAF_PLUGINS_DIR}/${p}" $param) + zaf_dbg "Saving ZAF_${p}_${param}" done zaf_remove_plugin "$(basename $p)" reinstalled=1