Add -V, clean up errors and help text (#259)

Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Félix Saparelli 2022-07-30 17:26:52 +12:00 committed by GitHub
parent 806f69832e
commit 47fd7c14a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 151 additions and 67 deletions

View file

@ -88,7 +88,19 @@ pub fn load_manifest_path<P: AsRef<Path>>(
manifest_path: P,
) -> Result<Manifest<Meta>, BinstallError> {
block_in_place(|| {
debug!("Reading manifest: {}", manifest_path.as_ref().display());
let manifest_path = manifest_path.as_ref();
let manifest_path = if manifest_path.is_dir() {
manifest_path.join("Cargo.toml")
} else if manifest_path.is_file() {
manifest_path.into()
} else {
return Err(BinstallError::CargoManifestPath);
};
debug!(
"Reading manifest at local path: {}",
manifest_path.display()
);
// Load and parse manifest (this checks file system for binary output names)
let manifest = Manifest::<Meta>::from_path_with_metadata(manifest_path)?;