Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"type": "git"
},
"dfinity": {
"ref": "master",
"ref": "v0.5.0-alpha.0",
"repo": "ssh://git@github.com/dfinity-lab/dfinity",
"rev": "fab97e01dcb3ad9e81f7c38098969a548e8ad8fd",
"rev": "85aa86a2b2a5fbba63caff11e38c3d157636658c",
"type": "git"
},
"motoko": {
Expand Down
17 changes: 8 additions & 9 deletions src/dfx/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,15 +370,14 @@ fn build_file(
};
motoko_compile(cache.as_ref(), &params, &HashMap::new())?;
std::fs::copy(&output_idl_path, &idl_file_path)?;
// Generate JS code
if canister_info.has_frontend() {
let output_did_js_path = canister_info.get_output_did_js_path();
let canister_id = canister_info.get_canister_id().ok_or_else(|| {
DfxError::BuildError(BuildErrorKind::CouldNotReadCanisterId())
})?;
build_did_js(cache.as_ref(), &output_idl_path, &output_did_js_path)?;
build_canister_js(&canister_id, &canister_info)?;
}
// Generate JS code even if the canister doesn't have a frontend. It might still be
// used by another canister's frontend.
let output_did_js_path = canister_info.get_output_did_js_path();
let canister_id = canister_info
.get_canister_id()
.ok_or_else(|| DfxError::BuildError(BuildErrorKind::CouldNotReadCanisterId()))?;
build_did_js(cache.as_ref(), &output_idl_path, &output_did_js_path)?;
build_canister_js(&canister_id, &canister_info)?;

Ok(())
}
Expand Down