diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-19 15:05:37 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-19 15:06:08 +0300 |
| commit | e53cea4ed6fdd49d70caacc1eccc07225bed5dd8 (patch) | |
| tree | dde9704f9117f9d5f287e550e7417180e1548149 /src/update.rs | |
| parent | ebb7c721d96995bb0f499f3ff4d4b251c0c30fda (diff) | |
fix: use gh api for star prompt
Diffstat (limited to 'src/update.rs')
| -rw-r--r-- | src/update.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/update.rs b/src/update.rs index aa2c1e3e..458a2323 100644 --- a/src/update.rs +++ b/src/update.rs @@ -829,16 +829,18 @@ fn prompt_to_star_repository() -> io::Result<bool> { } fn star_repository_with_gh() -> bool { + let endpoint = format!("/user/starred/{STAR_PROMPT_REPO}"); let mut command = Command::new("gh"); - command.args(["repo", "star", STAR_PROMPT_REPO]); + command + .args(["api", "--method", "PUT", endpoint.as_str(), "--silent"]) + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()); if command_status_succeeds_with_timeout(&mut command, GH_COMMAND_TIMEOUT) { eprintln!("starred {STAR_PROMPT_REPO}. thank you."); true } else { - eprintln!( - "could not star {STAR_PROMPT_REPO}; you can run `gh repo star {STAR_PROMPT_REPO}` manually." - ); false } } |
