Skip to content

Commit 8be8605

Browse files
committed
Update commands/web/woodoo_components/npm-deps
1 parent 6ade13b commit 8be8605

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

commands/web/woodoo_components/npm-deps

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ elif [[ $1 == "hyva-npm-update" && $2 == "" ]]; then
7575
done
7676
fi
7777

78-
# A command to check outdated npm dependencies for a specific theme
79-
if [[ $1 == "check-npm-deps" && $2 != "" ]]; then
78+
# A command to check outdated npm dependencies for a specific Hyvä theme
79+
if [[ $1 == "hyva-npm-check" && $2 != "" ]]; then
8080
THEME_TO_CHECK=$(grep -oP "(?<=${2}: ).*" "${PROJECT_CONFIG_FILE}" | cut -d ' ' -f 1 | tr -d '"')
8181
checkHyva "${THEME_TO_CHECK}"
8282
if [[ ${HYVA} == true ]]; then
@@ -85,4 +85,18 @@ if [[ $1 == "check-npm-deps" && $2 != "" ]]; then
8585
echo -e "${txtred}${ICON_ERROR} ${2} is not a Hyvä theme. Please check manually.${txtrst}"
8686
fi
8787
exit 0
88+
elif [[ $1 == "hyva-npm-check" && $2 == "" ]]; then
89+
checkThemePathExists silent
90+
THEMES_TO_CHECK=$(gum choose --cursor-prefix "[ ] " --unselected-prefix "[ ] " --selected-prefix "[✓] " --no-limit $THEMES_IN_CONFIG)
91+
for THEME_CODE in ${THEMES_TO_CHECK}; do
92+
THEMES_TO_CHECK=$(echo $(grep -oP '(?<='$THEME_CODE': ).*' $PROJECT_CONFIG_FILE) | cut -d ' ' -f 1 | sed 's/"//g')
93+
94+
# checks to figure out if it is a Hyvä Theme
95+
checkHyva "${THEMES_TO_CHECK}"
96+
if [[ ${HYVA} == true ]]; then
97+
checkNpmDeps "${THEMES_TO_CHECK}"
98+
else
99+
echo -e "${txtred}${ICON_ERROR} ${THEME_CODE} is not a Hyvä theme. Please check manually.${txtrst}"
100+
fi
101+
done
88102
fi

0 commit comments

Comments
 (0)