Skip to content

Commit 8846aa1

Browse files
authored
ledger-tool: save new snapshots to --snapshot-archive-path (solana-labs#24883)
1 parent 546730c commit 8846aa1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ledger-tool/src/main.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ fn main() {
13751375
.index(2)
13761376
.value_name("DIR")
13771377
.takes_value(true)
1378-
.help("Output directory for the snapshot [default: --ledger directory]"),
1378+
.help("Output directory for the snapshot [default: --snapshot-archive-path if present else --ledger directory]"),
13791379
)
13801380
.arg(
13811381
Arg::with_name("warp_slot")
@@ -2185,7 +2185,10 @@ fn main() {
21852185
}
21862186
("create-snapshot", Some(arg_matches)) => {
21872187
let output_directory = value_t!(arg_matches, "output_directory", PathBuf)
2188-
.unwrap_or_else(|_| ledger_path.clone());
2188+
.unwrap_or_else(|_| match &snapshot_archive_path {
2189+
Some(snapshot_archive_path) => snapshot_archive_path.clone(),
2190+
None => ledger_path.clone(),
2191+
});
21892192
let mut warp_slot = value_t!(arg_matches, "warp_slot", Slot).ok();
21902193
let remove_stake_accounts = arg_matches.is_present("remove_stake_accounts");
21912194
let new_hard_forks = hardforks_of(arg_matches, "hard_forks");

0 commit comments

Comments
 (0)