Skip to content

Commit

Permalink
Update cmd/soroban-cli/src/commands/contract/init.rs
Browse files Browse the repository at this point in the history
simplified appended check

Co-authored-by: Willem Wyndham <[email protected]>
  • Loading branch information
BlaineHeffron and willemneal authored Jul 23, 2024
1 parent 5f163fe commit 98ea14b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,16 @@ fn copy_contents(from: &Path, to: &Path, overwrite: bool) -> Result<(), Error> {
append_contents(&path, &new_path)?;
}

if overwrite && !appended {
println!("🔄 Overwriting {}", &new_path.to_string_lossy());
if overwrite && !append {
println!("🔄 Overwriting {new_path_str}");
} else {
println!(
"ℹ️ Skipped creating {} as it already exists",
&new_path.to_string_lossy()
"ℹ️ Skipped creating {new_path_str} as it already exists"
);
continue;
}
} else {
println!("➕ Writing {}", &new_path.to_string_lossy());
println!("➕ Writing {new_path_str}");
}
copy(&path, &new_path).map_err(|e| {
eprintln!(
Expand Down

0 comments on commit 98ea14b

Please sign in to comment.