mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-11-06 21:00:07 +01:00
🏗 WIP: Parsing version updates
This commit is contained in:
@@ -28,4 +28,22 @@ class Brew {
|
||||
Log.warn("The Homebrew version could not be determined.")
|
||||
}
|
||||
}
|
||||
|
||||
public func getPhpVersions() async -> [BrewFormula] {
|
||||
let command = """
|
||||
\(Paths.brew) update >/dev/null && \
|
||||
\(Paths.brew) outdated --json --formulae
|
||||
"""
|
||||
|
||||
let raw = await Shell.pipe(command).out
|
||||
print(raw)
|
||||
|
||||
// We can now figure out what updates there are
|
||||
|
||||
// We also know what's installed
|
||||
let items = PhpEnv.shared.cachedPhpInstallations.keys
|
||||
print(items)
|
||||
|
||||
return []
|
||||
}
|
||||
}
|
||||
|
||||
23
phpmon/Domain/Integrations/Homebrew/BrewFormula.swift
Normal file
23
phpmon/Domain/Integrations/Homebrew/BrewFormula.swift
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// BrewFormula.swift
|
||||
// PHP Monitor
|
||||
//
|
||||
// Created by Nico Verbruggen on 17/03/2023.
|
||||
// Copyright © 2023 Nico Verbruggen. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
struct BrewFormula {
|
||||
let name: String
|
||||
let installedVersion: String?
|
||||
let upgradeVersion: String?
|
||||
|
||||
var isInstalled: Bool {
|
||||
return installedVersion != nil
|
||||
}
|
||||
|
||||
var hasUpgrade: Bool {
|
||||
return upgradeVersion != nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user