From 504df4777fe8b550622f690c11332eed084b58c1 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 2 May 2022 19:44:00 +0000 Subject: [PATCH] ledger-tool: save new snapshots to --snapshot-archive-path (#24883) (#24896) (cherry picked from commit 8846aa12ca65c23aadb268933a62a16d0f652197) Co-authored-by: DimAn --- ledger-tool/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index c5311a830ed4ea..059380c993c97d 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -1324,7 +1324,7 @@ fn main() { .index(2) .value_name("DIR") .takes_value(true) - .help("Output directory for the snapshot [default: --ledger directory]"), + .help("Output directory for the snapshot [default: --snapshot-archive-path if present else --ledger directory]"), ) .arg( Arg::with_name("warp_slot") @@ -2130,7 +2130,10 @@ fn main() { } ("create-snapshot", Some(arg_matches)) => { let output_directory = value_t!(arg_matches, "output_directory", PathBuf) - .unwrap_or_else(|_| ledger_path.clone()); + .unwrap_or_else(|_| match &snapshot_archive_path { + Some(snapshot_archive_path) => snapshot_archive_path.clone(), + None => ledger_path.clone(), + }); let mut warp_slot = value_t!(arg_matches, "warp_slot", Slot).ok(); let remove_stake_accounts = arg_matches.is_present("remove_stake_accounts"); let new_hard_forks = hardforks_of(arg_matches, "hard_forks");