-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add version output #148
Conversation
Signed-off-by: Rui Chen <[email protected]>
4d30b85
to
4caa780
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help with the homebrew update. This is a great idea! Do you think there's a way to do this based on the latest git value or something automated? We're calling cli commands here
WhisperKit/Sources/WhisperKit/Core/Utils.swift
Lines 122 to 138 in c829f9a
extension Process { | |
static func stringFromTerminal(command: String) -> String { | |
let task = Process() | |
let pipe = Pipe() | |
task.standardOutput = pipe | |
task.launchPath = "/bin/bash" | |
task.arguments = ["-c", "sysctl -n " + command] | |
task.launch() | |
return String(bytes: pipe.fileHandleForReading.availableData, encoding: .utf8) ?? "" | |
} | |
static let processor = stringFromTerminal(command: "machdep.cpu.brand_string") | |
static let cores = stringFromTerminal(command: "machdep.cpu.core_count") | |
static let threads = stringFromTerminal(command: "machdep.cpu.thread_count") | |
static let vendor = stringFromTerminal(command: "machdep.cpu.vendor") | |
static let family = stringFromTerminal(command: "machdep.cpu.family") | |
} |
which seems to work well, perhaps current version could be a computed property based on
git describe --tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chenrui333 Updated this PR with the built-in version
param on CommandConfiguration
. I've updated the formula argmaxincbot/homebrew-core#1 such that it will use the tag from the URL to replace this placeholder, which will then be available in the build that homebrew makes. This way the version will always be up to date and self contained in the homebrew formula, lmk what you think
Tests are passing, will merge if there's no objections in a bit. |
yeah, if we can make sure version is good as part of the release script, all good to me |
* feat: add version output Signed-off-by: Rui Chen <[email protected]> * Add placeholder string for version via swift-argument-parser config --------- Signed-off-by: Rui Chen <[email protected]> Co-authored-by: ZachNagengast <[email protected]>
fixes #147
cc @ZachNagengast