mirror of
https://github.com/kuhyx/todo-app.git
synced 2026-11-10 19:07:02 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
file-length / file length <= 250 lines (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
28 lines
855 B
Bash
Executable File
28 lines
855 B
Bash
Executable File
#!/bin/bash
|
|
# Deploy: frozen binary + systemd --user unit; restarts the unit if running.
|
|
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
readonly ROOT
|
|
readonly BIN_DIR="${HOME}/.local/lib/todo-mcp"
|
|
readonly UNIT_DIR="${HOME}/.config/systemd/user"
|
|
readonly UNIT="todo-mcp.service"
|
|
|
|
main() {
|
|
mkdir -p "$BIN_DIR" "$UNIT_DIR"
|
|
(cd "$ROOT" && flutter pub get >/dev/null)
|
|
(cd "$ROOT" && dart compile exe mcp/todo_mcp.dart -o "$BIN_DIR/todo_mcp.new")
|
|
mv "$BIN_DIR/todo_mcp.new" "$BIN_DIR/todo_mcp"
|
|
install -m 644 "$ROOT/mcp/$UNIT" "$UNIT_DIR/$UNIT"
|
|
systemctl --user daemon-reload
|
|
if systemctl --user is-active --quiet "$UNIT"; then
|
|
systemctl --user restart "$UNIT"
|
|
echo "restarted $UNIT"
|
|
else
|
|
echo "installed; start with: systemctl --user enable --now $UNIT"
|
|
fi
|
|
}
|
|
|
|
main "$@"
|