2017-05-31 21:20:20 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
working_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
# curl and php are required
|
|
|
|
if [ "$( which curl )" == "" ] || [ "$( which php )" == "" ]; then
|
|
|
|
echo "curl and php are required!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-05-31 21:51:34 +08:00
|
|
|
cd ${working_dir}
|
2017-05-31 21:20:20 +08:00
|
|
|
generator="couscous.phar"
|
|
|
|
|
|
|
|
# download the generator if it's not already downloaded
|
2017-05-31 21:51:34 +08:00
|
|
|
if [ ! -f ${generator} ]; then
|
2017-05-31 21:20:20 +08:00
|
|
|
curl -OS http://couscous.io/${generator}
|
|
|
|
fi
|
|
|
|
|
|
|
|
# run the preview
|
2017-05-31 21:51:34 +08:00
|
|
|
php ${generator} preview
|