Skip to content

Commit 1b1dca9

Browse files
committed
"already built" is not an error
1 parent 6030e49 commit 1b1dca9

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/dfx/src/lib/builders/motoko.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,15 @@ impl CanisterBuilder for MotokoBuilder {
238238
};
239239
};
240240
} else {
241-
bail!("already compiled"); // FIXME: Ensure that `dfx` command doesn't return false because of this.
241+
// trace!(log, "Canister {} already compiled", canister_info.get_name()); // TODO
242+
return Ok(BuildOutput { // duplicate code
243+
canister_id: canister_info
244+
.get_canister_id()
245+
.expect("Could not find canister ID."),
246+
wasm: WasmBuildOutput::File(motoko_info.get_output_wasm_path().to_path_buf()),
247+
idl: IdlBuildOutput::File(motoko_info.get_output_idl_path().to_path_buf()),
248+
})
249+
242250
}
243251
}
244252
};
@@ -279,7 +287,7 @@ impl CanisterBuilder for MotokoBuilder {
279287
};
280288
motoko_compile(&self.logger, cache.as_ref(), &params)?;
281289

282-
Ok(BuildOutput {
290+
Ok(BuildOutput { // duplicate code
283291
canister_id: canister_info
284292
.get_canister_id()
285293
.expect("Could not find canister ID."),

0 commit comments

Comments
 (0)