From eb8bbfe9294838909b7b3029bec6288c6919d18c Mon Sep 17 00:00:00 2001 From: Bogdan Luca Date: Sat, 10 Mar 2018 11:36:47 +0200 Subject: [PATCH] Added wrapper support for diff and lint. --- wrapper.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/wrapper.sh b/wrapper.sh index d0935cb..5a7e662 100755 --- a/wrapper.sh +++ b/wrapper.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -ueo pipefail +shopt -s extglob # Redirect fds so that output to &3 is real stdout, and &1 goes to stderr # instead; this prevents accidentially intermixing with what helm sends to @@ -15,6 +16,9 @@ BLUE='\033[0;34m' YELLOW='\033[1;33m' NOC='\033[0m' +# constants +SUPPORTED_COMMANDS="@(install|upgrade|rollback|template|diff|lint)" + # set your own options : ${DECRYPT_CHARTS:=false} : ${BUILD_DEPS_AND_PACKAGE:=true} @@ -80,7 +84,7 @@ decrypt_helm_vars() { function cleanup { case "${CURRENT_COMMAND}" in - install|upgrade|rollback|template) + $SUPPORTED_COMMANDS) echo -e "${YELLOW}>>>>>>${NOC} ${BLUE}Cleanup${NOC}" for file in "${@}"; do @@ -109,7 +113,7 @@ function helm_cmd { } case "${CURRENT_COMMAND}" in - install|upgrade|rollback|template) + $SUPPORTED_COMMANDS) for file in "$@" do decrypt_helm_vars "$file"