aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/commands/create_project.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-23 15:11:36 +0900
committernsfisis <nsfisis@gmail.com>2026-02-23 15:11:36 +0900
commitd6e0c6d34449224ac3687daf551a0acfd15cee32 (patch)
treed6767718ad566542d4770d4688d9961e0f74ea3d /crates/mozart/src/commands/create_project.rs
parent7e45efd8a1f488b1a684f9efe31ff39009fc9e54 (diff)
downloadphp-mozart-d6e0c6d34449224ac3687daf551a0acfd15cee32.tar.gz
php-mozart-d6e0c6d34449224ac3687daf551a0acfd15cee32.tar.zst
php-mozart-d6e0c6d34449224ac3687daf551a0acfd15cee32.zip
refactor(cli): route command output through Console abstraction
Replace direct println\!/eprintln\! calls with console.write(), console.info(), and console.write_stdout() across all command handlers to respect verbosity settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/commands/create_project.rs')
-rw-r--r--crates/mozart/src/commands/create_project.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/crates/mozart/src/commands/create_project.rs b/crates/mozart/src/commands/create_project.rs
index da8108c..83ad21d 100644
--- a/crates/mozart/src/commands/create_project.rs
+++ b/crates/mozart/src/commands/create_project.rs
@@ -135,15 +135,17 @@ fn dir_from_package_name(package_name: &str) -> &str {
}
/// Remove VCS metadata directories from the target directory.
-fn remove_vcs_metadata(target_dir: &Path) -> anyhow::Result<()> {
+fn remove_vcs_metadata(
+ target_dir: &Path,
+ console: &mozart_core::console::Console,
+) -> anyhow::Result<()> {
for vcs_dir in VCS_DIRS {
let path = target_dir.join(vcs_dir);
if path.exists() {
std::fs::remove_dir_all(&path)?;
- eprintln!(
- "{}",
- console_format!("<comment>Removed VCS metadata directory: {vcs_dir}</comment>")
- );
+ console.info(&console_format!(
+ "<comment>Removed VCS metadata directory: {vcs_dir}</comment>"
+ ));
}
}
Ok(())
@@ -344,7 +346,7 @@ pub async fn execute(
// Default (neither flag): remove.
let vcs_removed = args.remove_vcs || !args.keep_vcs;
if vcs_removed {
- remove_vcs_metadata(&target_dir)?;
+ remove_vcs_metadata(&target_dir, console)?;
}
// --- Step 6: Read composer.json and optionally install dependencies ---