Skip to content
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

Fix keypair generation problem when directory does not exist #1556

Merged
merged 1 commit into from
Oct 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions genesis-tools/keypair-generator/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use clap::{App, Arg, SubCommand};
use near::get_default_home;
use near_crypto::{InMemorySigner, KeyType, SecretKey, Signer};
use std::fs;
use std::path::Path;

fn main() {
Expand Down Expand Up @@ -39,6 +40,7 @@ fn main() {
.get_matches();

let home_dir = matches.value_of("home").map(|dir| Path::new(dir)).unwrap();
fs::create_dir_all(home_dir).expect("Failed to create directory");
let account_id = matches.value_of("account-id");
let generate_config = matches.is_present("generate-config");

Expand Down