1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 03:50:08 +02:00

🔀 Merge branch 'dev/6.x' into dev/7.x

This commit is contained in:
2023-11-21 18:12:10 +01:00

View File

@ -41,6 +41,9 @@ class InstallAndUpgradeCommand: BrewCommand {
description: "PHP Monitor is preparing Homebrew..." description: "PHP Monitor is preparing Homebrew..."
)) ))
// Make sure the tap is installed
try await self.checkPhpTap(onProgress)
// Try to run all upgrade and installation operations // Try to run all upgrade and installation operations
try await self.upgradePackages(onProgress) try await self.upgradePackages(onProgress)
try await self.installPackages(onProgress) try await self.installPackages(onProgress)
@ -55,6 +58,18 @@ class InstallAndUpgradeCommand: BrewCommand {
await self.completedOperations(onProgress) await self.completedOperations(onProgress)
} }
private func checkPhpTap(_ onProgress: @escaping (BrewCommandProgress) -> Void) async throws {
if !BrewDiagnostics.installedTaps.contains("shivammathur/php") {
let command = "brew tap shivammathur/php"
try await run(command, onProgress)
}
if !BrewDiagnostics.installedTaps.contains("shivammathur/extensions") {
let command = "brew tap shivammathur/extensions"
try await run(command, onProgress)
}
}
private func upgradePackages(_ onProgress: @escaping (BrewCommandProgress) -> Void) async throws { private func upgradePackages(_ onProgress: @escaping (BrewCommandProgress) -> Void) async throws {
// If no upgrades are needed, early exit // If no upgrades are needed, early exit
if self.upgrading.isEmpty { if self.upgrading.isEmpty {