Skip to content

Commit

Permalink
[aptos-cli] Use current directory for workspace .aptos if it doesn't …
Browse files Browse the repository at this point in the history
…exist (#2845) (#2847)
  • Loading branch information
gregnazario authored Aug 12, 2022
1 parent 1a56a55 commit 4a95654
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/aptos/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,9 @@ fn find_workspace_config(
let cand = current_path.join(CONFIG_FOLDER);
if cand.is_dir() {
break Ok(cand);
}
if !current_path.pop() {
return Err(CliError::ConfigNotFoundError(format!(
"Unable to find {} in {} or any parent directory",
CONFIG_FOLDER,
starting_path.display()
)));
} else if !current_path.pop() {
// If we aren't able to find the folder, we'll create a new one right here
break Ok(starting_path.join(CONFIG_FOLDER));
}
}
}
Expand Down

0 comments on commit 4a95654

Please sign in to comment.