build: make kill-daemon/install/reinstall — daemon survives reinstall
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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}')
|
NATIVE_TRIPLE := $(shell rustc -vV 2>/dev/null | awk '/^host:/{print $$2}')
|
||||||
SIDECAR_DIR := $(APP_DIR)/src-tauri/bin
|
SIDECAR_DIR := $(APP_DIR)/src-tauri/bin
|
||||||
BUNDLE_CONFIG := src-tauri/tauri.bundle.conf.json
|
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)
|
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
|
LANDING_IMAGE := spacesh-landing
|
||||||
@@ -62,6 +64,21 @@ dev: ## run the app in dev mode (tauri dev)
|
|||||||
daemon: ## build & run the daemon
|
daemon: ## build & run the daemon
|
||||||
cargo run -p spaceshd
|
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 ----
|
# ---- Tests ----
|
||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
|
|||||||
Reference in New Issue
Block a user