From 6e642b9cf2f54d5e593fd5ded9246a6c4a61b5f8 Mon Sep 17 00:00:00 2001 From: Ahmad Afuni Date: Thu, 23 Mar 2023 13:52:23 +0100 Subject: [PATCH] fix(nargo): only search for `Nargo.toml` in commands which act on a Nargo package (#1029) * Fix `new` command. * Formatting --- crates/nargo/src/cli/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/nargo/src/cli/mod.rs b/crates/nargo/src/cli/mod.rs index 27f98b33ba6..7bf5afd4f69 100644 --- a/crates/nargo/src/cli/mod.rs +++ b/crates/nargo/src/cli/mod.rs @@ -63,8 +63,10 @@ enum NargoCommand { pub fn start_cli() -> eyre::Result<()> { let NargoCli { command, mut config } = NargoCli::parse(); - // Search through parent directories to find package root. - config.program_dir = find_package_root(&config.program_dir)?; + // Search through parent directories to find package root if necessary. + if !matches!(command, NargoCommand::New(_)) { + config.program_dir = find_package_root(&config.program_dir)?; + } match command { NargoCommand::New(args) => new_cmd::run(args, config),