Skip to content

Commit

Permalink
[genesis] Fix the genesis generate dir. (#3616)
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar authored Aug 4, 2022
1 parent 5d352ef commit e92d203
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file removed generated/halley/genesis
Binary file not shown.
8 changes: 8 additions & 0 deletions genesis/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ fn main() {
}
};
if regenerate {
let exec_path = std::env::args().next().expect("path of the executable");
let base_path = std::path::Path::new(&exec_path)
.parent()
.unwrap()
.join("../../genesis");

std::env::set_current_dir(&base_path).expect("failed to change directory");

let path = Path::new(G_GENESIS_GENERATED_DIR).join(net.to_string());
new_genesis.save(path.as_path()).expect("save genesis fail");
} else {
Expand Down

0 comments on commit e92d203

Please sign in to comment.