fix(abigen): use lib for parsing paths correctly in windows

This commit is contained in:
Georgios Konstantopoulos 2021-12-19 22:06:38 +02:00
parent 8d95f3bf33
commit be468bcf32
3 changed files with 3 additions and 1 deletions

1
Cargo.lock generated
View File

@ -1161,6 +1161,7 @@ dependencies = [
"Inflector",
"anyhow",
"cfg-if 1.0.0",
"dunce",
"ethers-core",
"getrandom 0.2.3",
"hex",

View File

@ -24,6 +24,7 @@ hex = { version = "0.4.2", default-features = false, features = ["std"] }
reqwest = { version = "0.11.3", default-features = false, features = ["blocking"] , optional = true }
once_cell = "1.8.0"
cfg-if = "1.0.0"
dunce = "1.0.2"
[target.'cfg(target_arch = "wasm32")'.dependencies]
# NOTE: this enables wasm compatibility for getrandom indirectly

View File

@ -229,7 +229,7 @@ fn get_local_contract(path: impl AsRef<str>) -> Result<String> {
let root = Path::new(&manifest_path);
let mut contract_path = root.join(&path);
if !contract_path.exists() {
contract_path = path.canonicalize()?;
contract_path = dunce::canonicalize(&path)?;
}
if !contract_path.exists() {
anyhow::bail!("Unable to find local contract \"{}\"", path.display())