Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tooling/nargo_cli/src/cli/check_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) struct CheckCommand {

/// Force overwrite of existing files
#[clap(long = "overwrite")]
allow_overwrite: bool,
pub(super) allow_overwrite: bool,

#[clap(flatten)]
compile_options: CompileOptions,
Expand Down
8 changes: 6 additions & 2 deletions tooling/nargo_cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,14 @@ fn command_dir(cmd: &NargoCommand, program_dir: &Path) -> Result<Option<PathBuf>
Ok(Some(nargo_toml::find_root(program_dir, workspace)?))
}

/// Returns:
/// - `Some(true)` if an exclusive lock is needed
/// - `Some(false)` if an read lock is needed
/// - None if no lock is needed
fn needs_lock(cmd: &NargoCommand) -> Option<bool> {
match cmd {
NargoCommand::Check(..)
| NargoCommand::Compile(..)
NargoCommand::Check(check_command) => Some(check_command.allow_overwrite),
NargoCommand::Compile(..)
| NargoCommand::Execute(..)
| NargoCommand::Export(..)
| NargoCommand::Info(..) => Some(true),
Expand Down