From 75b0a4fda50a78d33794fc47d8313cd12f0fef26 Mon Sep 17 00:00:00 2001 From: "Sebastian K. Sorensen" Date: Sun, 10 Jan 2021 17:40:38 +0100 Subject: [PATCH] Fix regex issue --- entrypoint.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 44e8a09..7543512 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -39,12 +39,14 @@ esac # Install plugins if [ -n "$INPUT_PRETTIER_PLUGINS" ]; then for plugin in $INPUT_PRETTIER_PLUGINS; do + echo "checking $plugin" # check regex against @prettier/xyz - REGEX = '(@prettier\/)+(plugin-[a-z\-]+)' - if ! [ "$plugin" =~ "$REGEX" ]; then - echo "Specified plugins does not seem to be valid @prettier/x plugins." + REGEX='(@prettier\/)+(plugin-[a-z\-]+)' + if ! [[ "$plugin" =~ "$REGEX" ]]; then + echo "$plugin does not seem to be a valid @prettier/plugin-x plugin." exit 1 fi + echo "$plugin seem to be a valid Prettier plugin" done npm install --silent --global $INPUT_PRETTIER_PLUGINS fi