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
simplify appended check

Co-authored-by: Willem Wyndham <[email protected]>
  • Loading branch information
BlaineHeffron and willemneal authored Jul 23, 2024
1 parent e93da7a commit 5f163fe
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,9 @@ fn copy_contents(from: &Path, to: &Path, overwrite: bool) -> Result<(), Error> {
} else {
let exists = file_exists(&new_path);
if exists {
let mut appended = false;
if new_path.to_string_lossy().contains(".gitignore") {
appended = true;
append_contents(&path, &new_path)?;
}
if new_path.to_string_lossy().contains("README.md") {
appended = true;
let new_path_str = new_path.to_string_lossy();
let append = new_path_str.contains(".gitignore") || new_path_str.contains("README.md");
if append {
append_contents(&path, &new_path)?;
}

Expand Down

0 comments on commit 5f163fe

Please sign in to comment.