mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-15 12:50:31 +02:00
Checking if generated files exist before trying to delete them
This commit is contained in:
@@ -66,8 +66,17 @@ 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"; }
|
||||||
|
|
||||||
# Ignore node modules and other action created files
|
# Ignore node modules and other action created files
|
||||||
rm -r node_modules/ || echo "No node_modules/ folder."
|
if [ -d 'node_modules' ]; then
|
||||||
git reset --hard package-lock.json || rm package-lock.json || echo "No package-lock.json file."
|
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
|
# To keep runtime good, just continue if something was changed
|
||||||
if _git_changed; then
|
if _git_changed; then
|
||||||
|
|||||||
Reference in New Issue
Block a user