diff --git a/PHP Monitor.xcodeproj/project.pbxproj b/PHP Monitor.xcodeproj/project.pbxproj index a1f46bdf..974d1497 100644 --- a/PHP Monitor.xcodeproj/project.pbxproj +++ b/PHP Monitor.xcodeproj/project.pbxproj @@ -3362,7 +3362,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1250; + CURRENT_PROJECT_VERSION = 1252; DEAD_CODE_STRIPPING = YES; DEBUG = YES; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3375,7 +3375,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 6.0; + MARKETING_VERSION = 6.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3392,7 +3392,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1250; + CURRENT_PROJECT_VERSION = 1252; DEAD_CODE_STRIPPING = YES; DEBUG = NO; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3405,7 +3405,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 6.0; + MARKETING_VERSION = 6.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3630,7 +3630,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1250; + CURRENT_PROJECT_VERSION = 1252; DEAD_CODE_STRIPPING = YES; DEBUG = NO; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3643,7 +3643,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 6.0; + MARKETING_VERSION = 6.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.dev; PRODUCT_NAME = "$(TARGET_NAME) DEV"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3744,7 +3744,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1250; + CURRENT_PROJECT_VERSION = 1252; DEAD_CODE_STRIPPING = YES; DEBUG = YES; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3757,7 +3757,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 6.0; + MARKETING_VERSION = 6.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.dev; PRODUCT_NAME = "$(TARGET_NAME) DEV"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -3858,7 +3858,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1250; + CURRENT_PROJECT_VERSION = 1252; DEAD_CODE_STRIPPING = YES; DEBUG = YES; DEVELOPMENT_TEAM = 8M54J5J787; @@ -3871,7 +3871,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 6.0; + MARKETING_VERSION = 6.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.eap; PRODUCT_NAME = "$(TARGET_NAME) EAP"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -4037,7 +4037,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1250; + CURRENT_PROJECT_VERSION = 1252; DEAD_CODE_STRIPPING = YES; DEBUG = NO; DEVELOPMENT_TEAM = 8M54J5J787; @@ -4050,7 +4050,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.4; - MARKETING_VERSION = 6.0; + MARKETING_VERSION = 6.0.1; PRODUCT_BUNDLE_IDENTIFIER = com.nicoverbruggen.phpmon.eap; PRODUCT_NAME = "$(TARGET_NAME) EAP"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/phpmon/Domain/App/InterAppHandler.swift b/phpmon/Domain/App/InterAppHandler.swift index 8bf4bbcd..1d88bd73 100644 --- a/phpmon/Domain/App/InterAppHandler.swift +++ b/phpmon/Domain/App/InterAppHandler.swift @@ -23,13 +23,13 @@ class InterApp { @MainActor static func getCommands() -> [InterApp.Action] { return [ InterApp.Action(command: "list", action: { _ in - DomainListVC.show() + if Valet.installed { DomainListVC.show() } }), InterApp.Action(command: "services/stop", action: { _ in - Task { MainMenu.shared.stopValetServices() } + if Valet.installed { Task { MainMenu.shared.stopValetServices() } } }), InterApp.Action(command: "services/restart/all", action: { _ in - Task { MainMenu.shared.restartValetServices() } + if Valet.installed { Task { MainMenu.shared.restartValetServices() } } }), InterApp.Action(command: "services/restart/nginx", action: { _ in Task { MainMenu.shared.restartNginx() } @@ -47,7 +47,7 @@ class InterApp { Task { MainMenu.shared.openGlobalComposerFolder() } }), InterApp.Action(command: "locate/valet", action: { _ in - Task { MainMenu.shared.openValetConfigFolder() } + if Valet.installed { Task { MainMenu.shared.openValetConfigFolder() } } }), InterApp.Action(command: "phpinfo", action: { _ in Task { MainMenu.shared.openPhpInfo() } diff --git a/phpmon/Domain/App/Services/ValetServicesManager.swift b/phpmon/Domain/App/Services/ValetServicesManager.swift index 3496e170..81922105 100644 --- a/phpmon/Domain/App/Services/ValetServicesManager.swift +++ b/phpmon/Domain/App/Services/ValetServicesManager.swift @@ -34,6 +34,10 @@ class ValetServicesManager: ServicesManager { these two commands are executed concurrently. */ override func reloadServicesStatus() async { + if !Valet.installed { + return Log.info("Not reloading services because running in Standalone Mode.") + } + await withTaskGroup(of: [HomebrewService].self, body: { group in // First, retrieve the status of the formulae that run as root group.addTask { diff --git a/phpmon/Domain/Menu/MainMenu.swift b/phpmon/Domain/Menu/MainMenu.swift index 885d9998..91d536c4 100644 --- a/phpmon/Domain/Menu/MainMenu.swift +++ b/phpmon/Domain/Menu/MainMenu.swift @@ -231,7 +231,13 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate func menuWillOpen(_ menu: NSMenu) { // Make sure the shortcut key does not trigger this when the menu is open App.shared.shortcutHotkey?.isPaused = true - Task { // Reload Homebrew services information asynchronously + + // Exit early if Valet is not detected (i.e. standalone mode) + if !Valet.installed { + return + } + + Task { // Reload Homebrew services information asynchronously, but only if Valet is enabled await ServicesManager.shared.reloadServicesStatus() } }