-
Notifications
You must be signed in to change notification settings - Fork 2.5k
fix: 3 issues (latest tag, ccusage fallback, versioning) #23
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| ".": "0.5.0" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "packages": { | ||
| ".": { | ||
| "release-type": "rust", | ||
| "package-name": "rtk", | ||
| "bump-minor-pre-major": true, | ||
| "bump-patch-for-minor-pre-major": true | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -82,33 +82,64 @@ struct MonthlyEntry { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // ββ Public API ββ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Check if ccusage CLI is available in PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pub fn is_available() -> bool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Check if ccusage binary exists in PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fn binary_exists() -> bool { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Command::new("which") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .arg("ccusage") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .output() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .map(|o| o.status.success()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .unwrap_or(false) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Build the ccusage command, falling back to npx if binary not in PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fn build_command() -> Option<Command> { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if binary_exists() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return Some(Command::new("ccusage")); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Fallback: try npx | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let npx_check = Command::new("npx") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .arg("ccusage") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .arg("--help") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .stdout(std::process::Stdio::null()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .stderr(std::process::Stdio::null()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .status(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if npx_check.map(|s| s.success()).unwrap_or(false) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+94
to
+108
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /// Build the ccusage command, falling back to npx if binary not in PATH | |
| fn build_command() -> Option<Command> { | |
| if binary_exists() { | |
| return Some(Command::new("ccusage")); | |
| } | |
| // Fallback: try npx | |
| let npx_check = Command::new("npx") | |
| .arg("ccusage") | |
| .arg("--help") | |
| .stdout(std::process::Stdio::null()) | |
| .stderr(std::process::Stdio::null()) | |
| .status(); | |
| if npx_check.map(|s| s.success()).unwrap_or(false) { | |
| /// Check if npx exists in PATH | |
| fn npx_exists() -> bool { | |
| Command::new("which") | |
| .arg("npx") | |
| .output() | |
| .map(|o| o.status.success()) | |
| .unwrap_or(false) | |
| } | |
| /// Build the ccusage command, falling back to npx if binary not in PATH | |
| fn build_command() -> Option<Command> { | |
| if binary_exists() { | |
| return Some(Command::new("ccusage")); | |
| } | |
| // Fallback: use npx if available | |
| if npx_exists() { |
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.
With
update-latest-tagremoved from this workflow, runs triggered bypushto version tags (v*) orworkflow_dispatchwill no longer advance thelatesttag. Ifrelease.ymlis still used for manual/tag-driven releases, consider re-adding alatestupdate step here (in addition to the release-please path) or moving the behavior to a workflow triggered onrelease/publishedevents.