mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-08 04:20:07 +02:00
👌 Force composer from /usr/local/bin (#102)
This commit is contained in:
@ -786,7 +786,7 @@ Gw
|
|||||||
<image name="arrow.clockwise" catalog="system" width="14" height="16"/>
|
<image name="arrow.clockwise" catalog="system" width="14" height="16"/>
|
||||||
<image name="plus" catalog="system" width="14" height="13"/>
|
<image name="plus" catalog="system" width="14" height="13"/>
|
||||||
<namedColor name="IconColorGreen">
|
<namedColor name="IconColorGreen">
|
||||||
<color red="0.2467108965" green="0.56980162858963013" blue="0.50060153009999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color red="0.2467108965" green="0.69713878631591797" blue="0.50060153009999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
</namedColor>
|
</namedColor>
|
||||||
</resources>
|
</resources>
|
||||||
</document>
|
</document>
|
||||||
|
@ -359,6 +359,14 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
private func updateGlobalDependencies(notify: Bool, completion: @escaping (Bool) -> Void) {
|
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
|
PhpEnv.shared.isBusy = true
|
||||||
setBusyImage()
|
setBusyImage()
|
||||||
self.rebuild()
|
self.rebuild()
|
||||||
@ -378,14 +386,12 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
|||||||
window?.setType(info: true)
|
window?.setType(info: true)
|
||||||
|
|
||||||
DispatchQueue.global(qos: .userInitiated).async {
|
DispatchQueue.global(qos: .userInitiated).async {
|
||||||
let output = Shell.user.executeSynchronously(
|
let task = Shell.user.createTask(
|
||||||
"composer global update", requiresPath: true
|
for: "/usr/local/bin/composer global update", requiresPath: true
|
||||||
)
|
)
|
||||||
|
|
||||||
let task = Shell.user.createTask(for: "composer global update", requiresPath: true)
|
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
window?.addToConsole("composer global update\n")
|
window?.addToConsole("/usr/local/bin/composer global update\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
Shell.captureOutput(
|
Shell.captureOutput(
|
||||||
@ -409,7 +415,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate {
|
|||||||
Shell.haltCapturingOutput(task)
|
Shell.haltCapturingOutput(task)
|
||||||
|
|
||||||
DispatchQueue.main.async {
|
DispatchQueue.main.async {
|
||||||
if output.task.terminationStatus <= 0 {
|
if task.terminationStatus <= 0 {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
|
||||||
window?.close()
|
window?.close()
|
||||||
if (notify) {
|
if (notify) {
|
||||||
|
@ -169,6 +169,9 @@
|
|||||||
// ALERTS
|
// ALERTS
|
||||||
|
|
||||||
// Composer Update
|
// 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.title" = "Updating global dependencies...";
|
||||||
"alert.composer_progress.info" = "You can see the progress in the terminal output below.";
|
"alert.composer_progress.info" = "You can see the progress in the terminal output below.";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user