chore: add no php option to deploy scripts

This commit is contained in:
Andreas Hubel 2022-05-13 14:10:46 +02:00
parent 7a65bc971d
commit 66b65a87a2
2 changed files with 18 additions and 16 deletions

View file

@ -1,14 +1,15 @@
#!/usr/bin/env bash
for cmd in find xargs php git; do
command -v $cmd >/dev/null 2>&1 || { echo >&2 "I require $cmd but it's not installed. Aborting."; exit 1; }
done
if [ "$1" != '--without-validation' ]; then
for cmd in find xargs php git; do
command -v $cmd >/dev/null 2>&1 || { echo >&2 "I require $cmd but it's not installed. Aborting."; exit 1; }
done
find . -name "*.php" -print0 | grep -va archive | xargs -0 -n1 php -l
if [ $? -ne 0 ]; then
echo "not deploying b0rken code ;)"
exit 1
find . -name "*.php" | grep -v archive | xargs -n1 php -l
if [ $? -ne 0 ]; then
echo "not deploying b0rken code ;)"
exit 1
fi
fi
echo ""

View file

@ -1,14 +1,15 @@
#!/usr/bin/env bash
for cmd in find xargs php git; do
command -v $cmd >/dev/null 2>&1 || { echo >&2 "I require $cmd but it's not installed. Aborting."; exit 1; }
done
if [ "$1" != '--without-validation' ]; then
for cmd in find xargs php git; do
command -v $cmd >/dev/null 2>&1 || { echo >&2 "I require $cmd but it's not installed. Aborting."; exit 1; }
done
find . -name "*.php" | grep -v archive | xargs -n1 php -l
if [ $? -ne 0 ]; then
echo "not deploying b0rken code ;)"
exit 1
find . -name "*.php" | grep -v archive | xargs -n1 php -l
if [ $? -ne 0 ]; then
echo "not deploying b0rken code ;)"
exit 1
fi
fi
echo ""