Skip to content

Commit

Permalink
Print out progress of copy_template_files
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Feb 9, 2024
1 parent 3f3738c commit eba795a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 10 deletions.
35 changes: 35 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/soroban-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ ureq = {version = "2.9.1", features = ["json"]}

tempfile = "3.8.1"
toml_edit = "0.21.0"
rust-embed = "8.2.0"
rust-embed = { version = "8.2.0", features = ["debug-embed"] }
# For hyper-tls
[target.'cfg(unix)'.dependencies]
openssl = { version = "0.10.55", features = ["vendored"] }
Expand Down
11 changes: 2 additions & 9 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::fs::read_to_string;
use std::num::NonZeroU32;
use std::path::Path;
use std::sync::atomic::AtomicBool;
use std::{env, fs, io};
use std::{fs, io};
use toml_edit::{Document, Formatted, InlineTable, TomlError, Value};

const SOROBAN_EXAMPLES_URL: &str = "https://github.com/stellar/soroban-examples.git";
Expand Down Expand Up @@ -142,14 +142,6 @@ fn init(
frontend_template: &String,
with_examples: &[String],
) -> Result<(), Error> {
let cli_cmd_root = env!("CARGO_MANIFEST_DIR");
let template_dir_path = Path::new(cli_cmd_root)
.join("src")
.join("utils")
.join("contract-init-template");

println!("template_dir_path: {template_dir_path:?}",);

// create a project dir, and copy the contents of the base template (contract-init-template) into it
std::fs::create_dir_all(project_path).map_err(|e| {
eprintln!("Error creating new project directory: {project_path:?}");
Expand Down Expand Up @@ -222,6 +214,7 @@ fn copy_template_files(project_path: &Path) -> Result<(), Error> {
e
})?;

println!("➕ Writing {}", &to.to_string_lossy());
fs::write(&to, file_contents).map_err(|e| {
eprintln!("Error writing file: {to:?}");
e
Expand Down

0 comments on commit eba795a

Please sign in to comment.