Skip to content

Commit

Permalink
create 0L folder when gh keys entered
Browse files Browse the repository at this point in the history
  • Loading branch information
nonast committed Mar 5, 2023
1 parent 7fdda59 commit 92001c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ol/genesis-tools/src/wizard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,16 @@ impl GenesisWizard {
fn git_token_check(&mut self) -> anyhow::Result<()> {
let gh_token_path = self.data_path.join("github_token.txt");
if !Path::exists(&gh_token_path) {
println!("no github token found");
match Input::<String>::new()
.with_prompt("No github token found, enter one now, or save to github_token.txt:")
.with_prompt("No github token found, enter one now, or save to github_token.txt")
.interact_text()
{
Ok(s) => {
// save the token to the file, and create the folders if necessary
std::fs::create_dir_all(&self.data_path)?;
std::fs::write(&gh_token_path, s)?;
}
_ => println!("somehow couldn't read what you typed "),
_ => println!("somehow couldn't read what you typed"),
}
}

Expand Down

0 comments on commit 92001c3

Please sign in to comment.