Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vporton committed Apr 26, 2024
1 parent 5c535ed commit 3b64f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dfx/src/lib/builders/motoko.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::lib::metadata::names::{CANDID_ARGS, CANDID_SERVICE};
use crate::lib::models::canister::{CanisterPool, Import, ImportsTracker};
use crate::lib::package_arguments::{self, PackageArguments};
use crate::util::assets::management_idl;
use anyhow::Context;
use anyhow::{Context, anyhow};
use candid::Principal as CanisterId;
use dfx_core::config::cache::Cache;
use dfx_core::config::model::dfinity::{MetadataVisibility, Profile};
Expand Down Expand Up @@ -57,7 +57,7 @@ pub fn add_imports(
pool: &CanisterPool,
top: Option<&CanisterInfo>, // hackish
) -> DfxResult {
let base_path = file.parent().unwrap(); // FIXME: `unwrap()`
let base_path = file.parent().ok_or_else(|| anyhow!("Cannot get base directory"))?;
let parent = if let Some(top) = top {
Import::Canister(top.get_name().to_string()) // a little inefficient
} else {
Expand Down

0 comments on commit 3b64f01

Please sign in to comment.