From ffcd4b26521b711996eaab1b415893251b7c4392 Mon Sep 17 00:00:00 2001 From: Steve Hamrick Date: Thu, 21 Jul 2022 09:14:26 -0600 Subject: [PATCH] Fix Pkg to Only Add Weasel if Already Exists (#6977) * Only add weasel if exists * Simplify --- pkg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg b/pkg index e7c2d4141e..a9efc2b4af 100755 --- a/pkg +++ b/pkg @@ -155,9 +155,10 @@ while getopts h78abdf:lopqvsSL opt; do esac done +CMD=$("${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services) # Weasel must be built first otherwise it will fail from build artifacts/cache in an environment that doesn't have git # e.g. the environment produced by `./pkg source`. -PROJECTS="weasel"$'\n'"$("${COMPOSECMD[@]}" -f $COMPOSE_FILE config --services | sed '/^weasel$/d')" +PROJECTS=$(grep -E "^weasel$" <<<"$CMD"; grep -Ev "^weasel$"<<<"$CMD") HELP_TEXT="$(cat <