dev.sh: Run php if there is no php7.0 in PATH

This commit is contained in:
Aaron Muir Hamilton 2018-02-03 22:17:37 +00:00
parent 1dd86537ba
commit 3be19879b9

8
dev.sh
View file

@ -1,5 +1,7 @@
#!/bin/bash #!/bin/bash
PHPBIN=php7.0
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -7,4 +9,8 @@ if [ ! -e "data/config.php" ]; then
cp "$DIR/data/config.php.example" "$DIR/data/config.php" cp "$DIR/data/config.php.example" "$DIR/data/config.php"
fi fi
php7.0 --server localhost:8000 --docroot "$DIR/web" "$DIR/web/index.php" if ! which $PHPBIN 2>/dev/null; then
PHPBIN=php
fi
$PHPBIN --server localhost:8000 --docroot "$DIR/web" "$DIR/web/index.php"