From 79b47d42e713930ad907c87e80102c374870e17f Mon Sep 17 00:00:00 2001 From: Vassiliy Yegorov Date: Mon, 15 Jun 2026 12:26:49 +0700 Subject: [PATCH] =?UTF-8?q?build:=20make=20kill-daemon/install/reinstall?= =?UTF-8?q?=20=E2=80=94=20daemon=20survives=20reinstall?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebuilding the .app never replaced the RUNNING daemon (it outlives the GUI), so a stale spaceshd kept serving old code (e.g. the pre-TERM-fix daemon). `make install` now stops the daemon, copies the fresh bundle to /Applications, and clears quarantine; `make reinstall` does dmg+install in one shot. Co-Authored-By: Claude Opus 4.8 (1M context) --- Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Makefile b/Makefile index ee53dd8..9f21c20 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ NATIVE_DMG_DIR := $(APP_DIR)/src-tauri/target/release/bundle/dmg NATIVE_TRIPLE := $(shell rustc -vV 2>/dev/null | awk '/^host:/{print $$2}') SIDECAR_DIR := $(APP_DIR)/src-tauri/bin BUNDLE_CONFIG := src-tauri/tauri.bundle.conf.json +APP_BUNDLE := $(APP_DIR)/src-tauri/target/$(TAURI_TARGET)/release/bundle/macos/spacesh.app +NATIVE_APP_BUNDLE := $(APP_DIR)/src-tauri/target/release/bundle/macos/spacesh.app APP_VERSION := $(shell node -p "require('./$(APP_DIR)/src-tauri/tauri.conf.json').version" 2>/dev/null || echo 0.0.0) LANDING_IMAGE := spacesh-landing @@ -62,6 +64,21 @@ dev: ## run the app in dev mode (tauri dev) daemon: ## build & run the daemon cargo run -p spaceshd +.PHONY: kill-daemon +kill-daemon: ## stop a running spaceshd so a freshly-built one takes over + -pkill -x spaceshd + -rm -f $$HOME/.spacesh/sock + +.PHONY: install +install: kill-daemon ## copy the built .app to /Applications, restart daemon, clear quarantine + rm -rf /Applications/spacesh.app + cp -R "$(APP_BUNDLE)" /Applications/ 2>/dev/null || cp -R "$(NATIVE_APP_BUNDLE)" /Applications/ + xattr -dr com.apple.quarantine /Applications/spacesh.app + @echo "Installed. The bundled daemon (with the latest code) starts on next launch." + +.PHONY: reinstall +reinstall: dmg install ## universal rebuild + reinstall + restart daemon (one shot) + # ---- Tests ---- .PHONY: test