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 Oct 27, 2024
1 parent 6ade13b commit 8be8605
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)

Check notice on line 90 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2086)

[new] Double quote to prevent globbing and word splitting.

Check notice on line 90 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.
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')

Check notice on line 92 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2005)

[new] Useless echo? Instead of 'echo $(cmd)', just use 'cmd'.

Check warning on line 92 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2046)

[new] Quote this to prevent word splitting.

Check notice on line 92 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2086)

[new] Double quote to prevent globbing and word splitting.

Check notice on line 92 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.

Check notice on line 92 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2086)

[new] Double quote to prevent globbing and word splitting.

Check notice on line 92 in commands/web/woodoo_components/npm-deps

View check run for this annotation

Trunk.io / Trunk Check

shellcheck(SC2250)

[new] Prefer putting braces around variable references even when not strictly required.

# 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 8be8605

Please sign in to comment.