mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-25 05:22:59 +00:00
Add theme server to start-server & improve --help docs
This commit is contained in:
parent
6f4d47b2bb
commit
639d20afdb
1 changed files with 16 additions and 5 deletions
21
build.sh
21
build.sh
|
@ -38,6 +38,7 @@ if [[ "$#" -lt 1 ]]; then
|
||||||
echo -e "${CSECTION}Available actions${RS}";
|
echo -e "${CSECTION}Available actions${RS}";
|
||||||
echo -e " ${CACTION}setup${RS} - Perform initial setup, check the environment (skip if only building Pepperminty Wiki itself)";
|
echo -e " ${CACTION}setup${RS} - Perform initial setup, check the environment (skip if only building Pepperminty Wiki itself)";
|
||||||
echo -e " ${CACTION}build${RS} - Build Pepperminty Wiki";
|
echo -e " ${CACTION}build${RS} - Build Pepperminty Wiki";
|
||||||
|
echo -e " ${CACTION}themes${RS} - Rebuild the theme index";
|
||||||
echo -e " ${CACTION}docs${RS} - Build the documentation";
|
echo -e " ${CACTION}docs${RS} - Build the documentation";
|
||||||
echo -e " ${CACTION}docs-livereload${RS} - Start the documentation livereload server";
|
echo -e " ${CACTION}docs-livereload${RS} - Start the documentation livereload server";
|
||||||
echo -e " ${CACTION}start-server${RS} - Start a development server";
|
echo -e " ${CACTION}start-server${RS} - Start a development server";
|
||||||
|
@ -235,15 +236,22 @@ task_docs-livereload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
task_start-server() {
|
task_start-server() {
|
||||||
task_begin "Starting Server";
|
task_begin "Starting server";
|
||||||
if [ -f "${server_pid_file}" ]; then
|
if [ -f "${server_pid_file}" ]; then
|
||||||
task_end 1 "${FRED}${HC}Error: A development server appears to be running already. Try running the 'stop-server' task before starting it again.${RS}";
|
task_end 1 "${FRED}${HC}Error: A development server appears to be running already. Try running the 'stop-server' task before starting it again.${RS}";
|
||||||
fi
|
fi
|
||||||
php -S [::]:35623 -t build/ &
|
php -S [::]:35623 -t build/ &
|
||||||
exit_code=$?; pid=$!;
|
local exit_code=$?; local pid=$!;
|
||||||
echo "${pid}" >"${server_pid_file}";
|
echo "${pid}" >"${server_pid_file}";
|
||||||
|
|
||||||
task_end "${exit_code}" "";
|
task_end "${exit_code}" "";
|
||||||
|
|
||||||
|
task_begin "Starting theme server";
|
||||||
|
php -S [::]:35624 -t themes/ &
|
||||||
|
exit_code=$?; pid=$!;
|
||||||
|
echo "${pid}" >"${server_pid_file}.themes";
|
||||||
|
task_end "${exit_code}";
|
||||||
|
|
||||||
if [[ -z "${NO_BROWSER}" ]]; then
|
if [[ -z "${NO_BROWSER}" ]]; then
|
||||||
task_begin "Opening Browser";
|
task_begin "Opening Browser";
|
||||||
sensible-browser [::]:35623;
|
sensible-browser [::]:35623;
|
||||||
|
@ -252,12 +260,15 @@ task_start-server() {
|
||||||
}
|
}
|
||||||
|
|
||||||
task_stop-server() {
|
task_stop-server() {
|
||||||
task_begin "Stopping Server";
|
task_begin "Stopping server";
|
||||||
|
|
||||||
kill "$(cat "${server_pid_file}")";
|
kill "$(cat "${server_pid_file}")";
|
||||||
rm "${server_pid_file}";
|
rm "${server_pid_file}";
|
||||||
|
|
||||||
task_end $?;
|
task_end $?;
|
||||||
|
|
||||||
|
task_begin "Stopping theme server";
|
||||||
|
kill "$(cat "${server_pid_file}.themes")";
|
||||||
|
rm "${server_pid_file}.themes";
|
||||||
|
task_end "$?";
|
||||||
}
|
}
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue