Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make missing manifest file error the same as Rust's. #785

Merged
merged 1 commit into from
Feb 14, 2022
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
7 changes: 4 additions & 3 deletions forc/src/ops/forc_abi_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{
};

use sway_types::{Function, JsonABI};
use sway_utils::find_manifest_dir;
use sway_utils::{find_manifest_dir, MANIFEST_FILE_NAME};

use anyhow::Result;
use serde_json::{json, Value};
Expand Down Expand Up @@ -41,8 +41,9 @@ pub fn build(command: JsonAbiCommand) -> Result<Value, String> {
Some(dir) => dir,
None => {
return Err(format!(
"No manifest file found in this directory or any parent directories of it: {:?}",
this_dir
"could not find `{}` in `{}` or any parent directory",
MANIFEST_FILE_NAME,
this_dir.display()
))
}
};
Expand Down
7 changes: 4 additions & 3 deletions forc/src/ops/forc_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::fs::{self, File};
use std::io::Write;
use std::sync::Arc;
use sway_core::{FinalizedAsm, TreeType};
use sway_utils::{constants, find_manifest_dir};
use sway_utils::{constants, find_manifest_dir, MANIFEST_FILE_NAME};

use sway_core::{
create_module, source_map::SourceMap, BuildConfig, BytecodeCompilationResult,
Expand Down Expand Up @@ -45,8 +45,9 @@ pub fn build(command: BuildCommand) -> Result<Vec<u8>, String> {
Some(dir) => dir,
None => {
return Err(format!(
"No manifest file found in this directory or any parent directories of it: {:?}",
this_dir
"could not find `{}` in `{}` or any parent directory",
MANIFEST_FILE_NAME,
this_dir.display(),
))
}
};
Expand Down
5 changes: 3 additions & 2 deletions forc/src/utils/cli_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ pub struct CliError {
impl CliError {
pub fn manifest_file_missing(curr_dir: PathBuf) -> Self {
let message = format!(
"Manifest file not found at {:?}. Project root should contain '{}'",
curr_dir, MANIFEST_FILE_NAME
"could not find `{}` in `{}` or any parent directory",
MANIFEST_FILE_NAME,
curr_dir.display()
);
Self { message }
}
Expand Down