Add byre install-tool and a Homebrew row to the Server tab

This commit is contained in:
Ian Gulliver
2026-10-22 21:17:36 -07:00
parent 7556135879
commit f70ee02af4
8 changed files with 208 additions and 26 deletions
+9 -5
View File
@@ -33,7 +33,7 @@ struct Check: Decodable {
let need: String
let `for`: String
let ok: Bool
let command: String
let tool: String
let fix: String
let blocking: Bool
}
@@ -57,8 +57,8 @@ struct ChecksView: View {
}
Text("\(need(check)), for \(check.for)").foregroundStyle(Palette.muted)
if !check.ok {
if !check.command.isEmpty {
CommandBox(command: check.command)
if !check.tool.isEmpty {
CommandBox(tool: check.tool)
}
if !check.fix.isEmpty {
Text(check.fix)
@@ -91,7 +91,7 @@ struct ChecksView: View {
}
private struct CommandBox: View {
let command: String
let tool: String
@ViewState private var copied = false
@ViewState private var failure: String?
@@ -107,7 +107,7 @@ private struct CommandBox: View {
private var box: some View {
HStack(alignment: .firstTextBaseline, spacing: 8) {
Text(verbatim: command)
Text(verbatim: "byre install-tool \(tool)")
.font(Fonts.font(12, mono: true))
.textSelection(.enabled)
.frame(maxWidth: .infinity, alignment: .leading)
@@ -125,6 +125,10 @@ private struct CommandBox: View {
.padding(.vertical, 2)
}
private var command: String {
"'\(serverHelper.replacingOccurrences(of: "'", with: "'\\''"))' install-tool \(tool)"
}
private func copy() {
copyToClipboard(command)
copied = true