Displaying prettier error when a glob doesn't match any files

This commit is contained in:
Pedro Rodrigues
2021-06-21 23:05:35 -03:00
parent 8002e3525b
commit 6c9f8f188e

View File

@@ -2,7 +2,7 @@
# e is for exiting the script automatically if a command fails, u is for exiting if a variable is not set
# x would be for showing the commands before they are executed
set -eu
shopt -s globstar nullglob
shopt -s globstar
# FUNCTIONS
# Function for setting up git env in the docker container (copied from https://github.com/stefanzweifel/git-auto-commit-action/blob/master/entrypoint.sh)
@@ -63,7 +63,8 @@ fi
PRETTIER_RESULT=0
echo "Prettifying files..."
echo "Files:"
prettier $INPUT_PRETTIER_OPTIONS || { PRETTIER_RESULT=$?; echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"; }
prettier $INPUT_PRETTIER_OPTIONS \
|| { PRETTIER_RESULT=$?; echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"; exit 1; }
# Ignore node modules and other action created files
if [ -d 'node_modules' ]; then