build: Add development web server build tasks
This commit is contained in:
parent
80a8833c03
commit
a1516a67bc
1 changed files with 30 additions and 0 deletions
30
build
30
build
|
@ -161,6 +161,36 @@ task_client-watch() {
|
|||
}
|
||||
|
||||
|
||||
# ██████ ███████ ██ ██ ███████ ███████ ██████ ██ ██ ███████ ██████
|
||||
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||
# ██ ██ █████ ██ ██ █████ ███████ █████ ██████ ██ ██ █████ ██████
|
||||
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
||||
# ██████ ███████ ████ ███████ ███████ ██ ██ ████ ███████ ██ ██
|
||||
|
||||
task_dev-server() {
|
||||
task_begin "Starting development server";
|
||||
php -S "[::1]:40382" -t "app" &
|
||||
exit_code=$?;
|
||||
[[ "${exit_code}" -eq "0" ]] && echo $! >/tmp/summer-project-dev-server.pid;
|
||||
task_end $?; # Should be 0 unless php died for some reason
|
||||
sleep 1;
|
||||
}
|
||||
|
||||
task_dev-server-stop() {
|
||||
task_begin "Stopping development server";
|
||||
|
||||
if [ ! -f "/tmp/summer-project-dev-server.pid" ]; then
|
||||
echo -e "${HC}${FRED}Error: The development server doesn't appear to be running, so it can't be stopped. Have you tried running ./build dev-server?${RESET}";
|
||||
return 1;
|
||||
fi
|
||||
|
||||
kill "$(cat /tmp/summer-project-dev-server.pid)";
|
||||
rm /tmp/summer-project-dev-server.pid;
|
||||
|
||||
task_end $?;
|
||||
}
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue