Skip to content

Commit

Permalink
Ensure a canister is created when building it
Browse files Browse the repository at this point in the history
  • Loading branch information
yanliu38 committed Jul 13, 2024
1 parent 170f9ae commit 5be6624
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ic-canister/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ pub fn main() {
for var in vars_to_unset.iter() {
std::env::remove_var(var);
}
if !Command::new("dfx")
.args(["canister", "create", "--all"])
.current_dir(&canister_dir_path)
.status()
.expect("Failed to create canister")
.success()
{
panic!("failed to create canister")
};

if !Command::new("dfx")
.args(["build"])
Expand Down

0 comments on commit 5be6624

Please sign in to comment.