Skip to content

Commit

Permalink
Checking if generated files exist before trying to delete them
Browse files Browse the repository at this point in the history
  • Loading branch information
hpedrorodrigues committed Jun 22, 2021
1 parent aeab425 commit c97500d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,17 @@ echo "Files:"
prettier $INPUT_PRETTIER_OPTIONS || { PRETTIER_RESULT=$?; echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"; }

# Ignore node modules and other action created files
rm -r node_modules/ || echo "No node_modules/ folder."
git reset --hard package-lock.json || rm package-lock.json || echo "No package-lock.json file."
if [ -d 'node_modules' ]; then
rm -r node_modules/
else
echo "No node_modules/ folder."
fi

if [ -f 'package-lock.json' ]; then
git reset --hard package-lock.json || rm package-lock.json
else
echo "No package-lock.json file."
fi

# To keep runtime good, just continue if something was changed
if _git_changed; then
Expand Down

0 comments on commit c97500d

Please sign in to comment.