Skip to content

Commit 8817da1

Browse files
committed
Create swarm dir if it doesn't exist
1 parent 224205e commit 8817da1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/bin/lightdock-rust.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ fn run() {
139139
);
140140
}
141141
_ => {
142-
println!(
142+
eprintln!(
143143
"Wrong command line. Usage: {} setup_filename swarm_filename steps method",
144144
args[0]
145145
);
@@ -177,7 +177,11 @@ fn simulate(
177177
.map(|m| m.is_dir())
178178
.unwrap_or(false)
179179
{
180-
panic!("Output directory does not exist for swarm {:?}", swarm_id);
180+
eprintln!(
181+
"Output directory does not exist for swarm {:?}, creating it",
182+
swarm_id
183+
);
184+
fs::create_dir(&swarm_directory).expect("Error creating directory");
181185
}
182186

183187
println!("Writing to swarm dir {:?}", swarm_directory);

0 commit comments

Comments
 (0)