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