Skip to content

Commit

Permalink
Update commands/web/woodoo_components/npm-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
dermatz committed Nov 16, 2024
1 parent f232807 commit 336e098
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions commands/web/woodoo_components/npm-deps
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ elif [[ $1 == "hyva-npm-update" && $2 == "" ]]; then
done
fi

# A command to check outdated npm dependencies for a specific theme
if [[ $1 == "check-npm-deps" && $2 != "" ]]; then
# A command to check outdated npm dependencies for a specific Hyvä theme
if [[ $1 == "hyva-npm-check" && $2 != "" ]]; then
THEME_TO_CHECK=$(grep -oP "(?<=${2}: ).*" "${PROJECT_CONFIG_FILE}" | cut -d ' ' -f 1 | tr -d '"')
checkHyva "${THEME_TO_CHECK}"
if [[ ${HYVA} == true ]]; then
Expand All @@ -85,4 +85,18 @@ if [[ $1 == "check-npm-deps" && $2 != "" ]]; then
echo -e "${txtred}${ICON_ERROR} ${2} is not a Hyvä theme. Please check manually.${txtrst}"
fi
exit 0
elif [[ $1 == "hyva-npm-check" && $2 == "" ]]; then
checkThemePathExists silent
THEMES_TO_CHECK=$(gum choose --cursor-prefix "[ ] " --unselected-prefix "[ ] " --selected-prefix "[✓] " --no-limit $THEMES_IN_CONFIG)
for THEME_CODE in ${THEMES_TO_CHECK}; do
THEMES_TO_CHECK=$(echo $(grep -oP '(?<='$THEME_CODE': ).*' $PROJECT_CONFIG_FILE) | cut -d ' ' -f 1 | sed 's/"//g')

# checks to figure out if it is a Hyvä Theme
checkHyva "${THEMES_TO_CHECK}"
if [[ ${HYVA} == true ]]; then
checkNpmDeps "${THEMES_TO_CHECK}"
else
echo -e "${txtred}${ICON_ERROR} ${THEME_CODE} is not a Hyvä theme. Please check manually.${txtrst}"
fi
done
fi

0 comments on commit 336e098

Please sign in to comment.