Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vporton committed Jan 29, 2025
1 parent 4f21c99 commit 04d29e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/dfx/src/commands/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,17 @@ fn make_target(graph: &Graph<Import, ()>, node_id: <Graph<Import, ()> as GraphBa
format!("{} {}", path1, path2)
}
Import::FullPath(path) => format!("$(ROOT_DIR)/{}", path.to_str().unwrap_or("<unknown>").to_owned()), // TODO: <unknown> is a hack
Import::Ic(principal_str) => format!("ic:{}", principal_str),
Import::Ic(canister_name) => format!("canister@{}", canister_name),
Import::Lib(_path) => "".to_string(),
})
}

fn get_build_command(graph: &Graph<Import, ()>, node_id: <Graph<Import, ()> as GraphBase>::NodeId) -> Option<String> {
let node_value = graph.node_weight(node_id).unwrap();
match node_value {
Import::Canister(canister_name) =>
Import::Canister(canister_name) | Import::Ic(canister_name) =>
Some(format!("dfx canister create {}\n\tdfx build --no-deps {}", canister_name, canister_name)),
Import::FullPath(_path) => None,
Import::Ic(principal_str) => Some(format!("dfx deploy --no-compile {}", principal_str)), // FIXME
Import::Lib(_path) => None,
}
}
2 changes: 1 addition & 1 deletion src/dfx/src/lib/models/canister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ pub enum Import {
Canister(String),
Ic(String),
Lib(String), // TODO: Unused, because package manager never update existing files (but create new dirs)
FullPath(PathBuf),
FullPath(PathBuf), // TODo: Rename, because it's now relative.
}

impl Display for Import {
Expand Down

0 comments on commit 04d29e4

Please sign in to comment.