lmjtfy.git / tools / stop-dev.sh
1#!/usr/bin/env bash

Stop the dev server before a deploy, which builds into the same build/.

tools/stop-dev.sh

mise daemons stop worker fails with "no matching project daemons" when the daemon has never been started on this machine (mise lists it as available), and a deploy from such a machine is the ordinary case. So: nothing to stop is not an error; a daemon that is there and will not stop is.

10set -euo pipefail
11cd "$(dirname "$0")/.."
12state="$(mise daemons ls 2>/dev/null | awk '$1 ~ /\/worker$/ { print $2 }')"
13case "$state" in
14  "" | available) exit 0 ;;
15  *) exec mise daemons stop worker ;;
16esac