Skip to content

Commit 77395d1

Browse files
authored
Check that gh is installed and document it's needed (#251)
* ensure `gh` is present to compute actions to generate issues * document `gh` requirement
1 parent 249a062 commit 77395d1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

crates/rust-project-goals-cli/src/rfc.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ pub fn generate_issues(
110110
commit: bool,
111111
sleep: u64,
112112
) -> anyhow::Result<()> {
113+
// Verify the `gh` client is installed to compute which actions need to be taken in the repo.
114+
let sanity_check = Command::new("gh").arg("--version").output();
115+
if sanity_check.is_err() {
116+
return Err(anyhow::anyhow!(
117+
"The github `gh` client is missing and needs to be installed and configured with a token."
118+
));
119+
}
120+
113121
// Hacky but works: we loop because after creating the issue, we sometimes have additional sync to do,
114122
// and it's easier this way.
115123
loop {

src/admin/commands.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Commands
22

3-
The `cargo rpg` command is a CLI for manipulating and checking project goals. This section provides a reference describing (some of) the ability commands. You can also try `cargo rpg --help` to get a summary.
3+
The `cargo rpg` command is a CLI for manipulating and checking project goals. This section provides a reference describing (some of) the ability commands. You can also try `cargo rpg --help` to get a summary.
4+
5+
Note that this relies on the [`gh` client](https://github.com/cli/cli), which needs to be installed and configured with a token (for example using `gh auth login`).

0 commit comments

Comments
 (0)