mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-14 00:27:12 +00:00
1a589fcf32
* fix(examples/build): let ctrl-c stop trunk * doc(examples/build): add stop server hints
34 lines
846 B
TOML
34 lines
846 B
TOML
[tasks.start-server]
|
|
|
|
[tasks.stop-server]
|
|
condition = { env_set = ["SERVER_PROCESS_NAME"] }
|
|
script = '''
|
|
if [ ! -z $(pidof ${SERVER_PROCESS_NAME}) ]; then
|
|
pkill -ef ${SERVER_PROCESS_NAME}
|
|
fi
|
|
'''
|
|
|
|
[tasks.server-status]
|
|
condition = { env_set = ["SERVER_PROCESS_NAME"] }
|
|
script = '''
|
|
if [ -z $(pidof ${SERVER_PROCESS_NAME}) ]; then
|
|
echo " ${SERVER_PROCESS_NAME} is not running"
|
|
else
|
|
echo " ${SERVER_PROCESS_NAME} is up"
|
|
fi
|
|
'''
|
|
|
|
[tasks.maybe-start-server]
|
|
condition = { env_set = ["SERVER_PROCESS_NAME"] }
|
|
script = '''
|
|
YELLOW="\e[0;33m"
|
|
RESET="\e[0m"
|
|
|
|
if [ -z $(pidof ${SERVER_PROCESS_NAME}) ]; then
|
|
echo " Starting ${SERVER_PROCESS_NAME}"
|
|
echo " ${YELLOW}>> Run cargo make stop to end process${RESET}"
|
|
cargo make start-server ${@} &
|
|
else
|
|
echo " ${SERVER_PROCESS_NAME} is already started"
|
|
fi
|
|
'''
|