mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-03-31 16:50:09 +02:00
🚧 WIP: Changes related to unavailable formulae
This commit is contained in:
@@ -55,6 +55,7 @@ struct BrewPhpFormula: Equatable {
|
|||||||
|
|
||||||
return FileSystem.fileExists(
|
return FileSystem.fileExists(
|
||||||
"\(Paths.tapPath)/shivammathur/homebrew-php/Formula/php@\(version).rb"
|
"\(Paths.tapPath)/shivammathur/homebrew-php/Formula/php@\(version).rb"
|
||||||
|
.replacingOccurrences(of: "php@" + PhpEnvironments.brewPhpAlias, with: "php")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -269,16 +269,7 @@ struct PhpVersionManagerView: View {
|
|||||||
.font(.system(size: 11))
|
.font(.system(size: 11))
|
||||||
.foregroundColor(.gray)
|
.foregroundColor(.gray)
|
||||||
} else if !formula.hasFormulaFile {
|
} else if !formula.hasFormulaFile {
|
||||||
HStack(spacing: 5) {
|
unavailableFormula()
|
||||||
Text("phpman.version.unavailable".localizedForSwiftUI)
|
|
||||||
.font(.system(size: 11))
|
|
||||||
.foregroundColor(.gray)
|
|
||||||
HelpButton(action: {
|
|
||||||
// Show an alert that displays information about the missing formula
|
|
||||||
// and what can be done to fix this particular issue.
|
|
||||||
// Running `brew tap shivammathur/php` generally works, I think.
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Text("phpman.version.available_for_installation".localizedForSwiftUI)
|
Text("phpman.version.available_for_installation".localizedForSwiftUI)
|
||||||
.font(.system(size: 11))
|
.font(.system(size: 11))
|
||||||
@@ -294,6 +285,19 @@ struct PhpVersionManagerView: View {
|
|||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private func unavailableFormula() -> some View {
|
||||||
|
HStack(spacing: 5) {
|
||||||
|
Text("phpman.version.unavailable".localizedForSwiftUI)
|
||||||
|
.font(.system(size: 11))
|
||||||
|
.foregroundColor(.gray)
|
||||||
|
HelpButton(action: {
|
||||||
|
// Show an alert that displays information about the missing formula
|
||||||
|
// and what can be done to fix this particular issue.
|
||||||
|
// Running `brew tap shivammathur/php` generally works, I think.
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private func formulaIcon(for formula: BrewPhpFormula) -> some View {
|
private func formulaIcon(for formula: BrewPhpFormula) -> some View {
|
||||||
Image(systemName: formula.icon)
|
Image(systemName: formula.icon)
|
||||||
.resizable()
|
.resizable()
|
||||||
|
|||||||
Reference in New Issue
Block a user