From 9e91f100d97a458fb8230bc3976b15fa3c09e8aa Mon Sep 17 00:00:00 2001 From: Sebastian <379651+czarly@users.noreply.github.com> Date: Tue, 24 Sep 2024 07:08:03 +0200 Subject: [PATCH] parameterize --- show-status.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/show-status.sh b/show-status.sh index 348893ec..e91936d7 100755 --- a/show-status.sh +++ b/show-status.sh @@ -15,6 +15,19 @@ for part in "${parts[@]}"; do include=false fi done + + # Check if any parameters were passed + if [ $# -gt 0 ]; then + # Put parameters into an array (list) + params=("$@") + + # Check if a string is part of the list + if [[ " ${params[@]} " =~ " $1 " ]]; then + include=true # don't change anything + else + include=false + fi + fi if $include; then result=$($BASEPATH/sync-status.sh "${part%.yml}")