初始化项目
This commit is contained in:
26
bin/fswatch
Normal file
26
bin/fswatch
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
WORK_DIR=$1
|
||||
if [ ! -n "${WORK_DIR}" ] ;then
|
||||
WORK_DIR="."
|
||||
fi
|
||||
|
||||
echo "Restarting LaravelS..."
|
||||
./bin/laravels restart -d -i
|
||||
|
||||
echo "Starting fswatch..."
|
||||
LOCKING=0
|
||||
fswatch -e ".*" -i "\\.php$" -r ${WORK_DIR} | while read file
|
||||
do
|
||||
if [[ ! ${file} =~ .php$ ]] ;then
|
||||
continue
|
||||
fi
|
||||
if [ ${LOCKING} -eq 1 ] ;then
|
||||
echo "Reloading, skipped."
|
||||
continue
|
||||
fi
|
||||
echo "File ${file} has been modified."
|
||||
LOCKING=1
|
||||
./bin/laravels reload
|
||||
LOCKING=0
|
||||
done
|
||||
exit 0
|
||||
Reference in New Issue
Block a user