1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-06 19:40:08 +02:00

👌 Install additional taps

The following taps are now automatically installed:

- `shivammathur/php`
- `shivammathur/extensions`
This commit is contained in:
2023-11-21 18:11:18 +01:00
parent 07b17f3f84
commit d714d7ad4c

View File

@ -41,6 +41,9 @@ class InstallAndUpgradeCommand: BrewCommand {
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 await self.upgradePackages(onProgress)
try await self.installPackages(onProgress)
@ -55,6 +58,18 @@ class InstallAndUpgradeCommand: BrewCommand {
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 {
// If no upgrades are needed, early exit
if self.upgrading.isEmpty {