Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmd/mind-map/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func newServiceConfig(addr, dir, webui string, idleTimeout time.Duration) *servi
if runtime.GOOS == "darwin" {
cfg.Option = service.KeyValue{
"UserService": true,
"RunAtLoad": true,
}
} else if runtime.GOOS == "linux" {
cfg.UserName = os.Getenv("SUDO_USER")
Expand Down Expand Up @@ -170,8 +171,12 @@ var serviceStartCmd = &cobra.Command{
return fmt.Errorf("start service: %w", err)
}
fmt.Println("Service started.")
fmt.Printf(" Web UI: http://%s\n", addr)
fmt.Printf(" MCP endpoint: http://%s/mcp\n", addr)
// Only print the address if explicitly provided; otherwise the plist
// may contain a different addr than the flag default.
if cmd.Flags().Changed("addr") {
fmt.Printf(" Web UI: http://%s\n", addr)
fmt.Printf(" MCP endpoint: http://%s/mcp\n", addr)
}
return nil
},
}
Expand Down
11 changes: 9 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,15 @@ mkdir -p "${HOME}/.mind-map"

# Stop existing service before replacing the binary
if [ -f "${INSTALL_DIR}/mind-map" ]; then
sudo "${INSTALL_DIR}/mind-map" service stop 2>/dev/null && \
echo "==> Stopped existing mind-map service" || true
# On macOS the service is a user LaunchAgent; sudo would look for the plist
# under /var/root instead of ~/Library/LaunchAgents, so don't use sudo.
if [[ "$(uname -s)" == "Darwin" ]]; then
"${INSTALL_DIR}/mind-map" service stop 2>/dev/null && \
echo "==> Stopped existing mind-map service" || true
else
sudo "${INSTALL_DIR}/mind-map" service stop 2>/dev/null && \
echo "==> Stopped existing mind-map service" || true
fi
fi

echo "==> Downloading ${TARBALL_NAME}..."
Expand Down