script/research/gg: create transactions folder if it doesn't exists

This commit is contained in:
skoupidi
2025-10-30 14:23:34 +02:00
parent 64b167e134
commit 9fa8610650

View File

@@ -17,7 +17,7 @@
*/ */
use std::{ use std::{
fs::{read_dir, read_to_string}, fs::{create_dir, read_dir, read_to_string},
io::{stdin, Cursor, Read}, io::{stdin, Cursor, Read},
process::exit, process::exit,
str::FromStr, str::FromStr,
@@ -145,6 +145,9 @@ fn main() -> Result<()> {
// Grab genesis transactions from folder // Grab genesis transactions from folder
let txs_folder = expand_path(&txs_folder).unwrap(); let txs_folder = expand_path(&txs_folder).unwrap();
if !txs_folder.exists() {
create_dir(&txs_folder)?;
}
let mut tree = MerkleTree::new(1); let mut tree = MerkleTree::new(1);
for file in read_dir(txs_folder)? { for file in read_dir(txs_folder)? {
let file = file?; let file = file?;