1
0
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:
2023-03-17 20:38:21 +01:00
parent 7e04f8b881
commit 8f1304308d
6 changed files with 265 additions and 11 deletions

View File

@@ -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 []
}
}

View 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
}
}