diff --git a/phpmon/Domain/Core/Base.lproj/Main.storyboard b/phpmon/Domain/Core/Base.lproj/Main.storyboard
index e1c35ad..e1169a3 100644
--- a/phpmon/Domain/Core/Base.lproj/Main.storyboard
+++ b/phpmon/Domain/Core/Base.lproj/Main.storyboard
@@ -786,7 +786,7 @@ Gw
-
+
diff --git a/phpmon/Domain/Menu/MainMenu.swift b/phpmon/Domain/Menu/MainMenu.swift
index b515d4a..88734bc 100644
--- a/phpmon/Domain/Menu/MainMenu.swift
+++ b/phpmon/Domain/Menu/MainMenu.swift
@@ -359,6 +359,14 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
*/
private func updateGlobalDependencies(notify: Bool, completion: @escaping (Bool) -> Void) {
+ if !Shell.fileExists("/usr/local/bin/composer") {
+ Alert.notify(
+ message: "alert.composer_missing.title".localized,
+ info: "alert.composer_missing.info".localized
+ )
+ return
+ }
+
PhpEnv.shared.isBusy = true
setBusyImage()
self.rebuild()
@@ -378,14 +386,12 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
window?.setType(info: true)
DispatchQueue.global(qos: .userInitiated).async {
- let output = Shell.user.executeSynchronously(
- "composer global update", requiresPath: true
+ let task = Shell.user.createTask(
+ for: "/usr/local/bin/composer global update", requiresPath: true
)
- let task = Shell.user.createTask(for: "composer global update", requiresPath: true)
-
DispatchQueue.main.async {
- window?.addToConsole("composer global update\n")
+ window?.addToConsole("/usr/local/bin/composer global update\n")
}
Shell.captureOutput(
@@ -409,7 +415,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
Shell.haltCapturingOutput(task)
DispatchQueue.main.async {
- if output.task.terminationStatus <= 0 {
+ if task.terminationStatus <= 0 {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
window?.close()
if (notify) {
diff --git a/phpmon/Localizable.strings b/phpmon/Localizable.strings
index 5763c5a..9eeca45 100644
--- a/phpmon/Localizable.strings
+++ b/phpmon/Localizable.strings
@@ -169,6 +169,9 @@
// ALERTS
// Composer Update
+"alert.composer_missing.title" = "Composer not found!";
+"alert.composer_missing.info" = "Make sure you have Composer available in `/usr/local/bin/composer`. If Composer is located somewhere else, please create a symlink, like so (make sure to use the correct path):\n\n`ln -s /path/to/composer /user/local/bin`.";
+
"alert.composer_progress.title" = "Updating global dependencies...";
"alert.composer_progress.info" = "You can see the progress in the terminal output below.";