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
1 change: 0 additions & 1 deletion src/dfx/src/commands/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ pub fn exec(env: &dyn Environment, args: &ArgMatches<'_>) -> DfxResult {

slog::info!(logger, "Building canisters...");

// TODO: remove the forcing of generating canister id once we have an update flow.
canister_pool.build_or_fail(
BuildConfig::from_config(&config)?
.with_skip_frontend(args.is_present("skip-frontend"))
Expand Down
16 changes: 13 additions & 3 deletions src/dfx/src/commands/canister/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::lib::error::{DfxError, DfxResult};
use crate::lib::message::UserMessage;
use crate::lib::models::canister_id_store::CanisterIdStore;
use crate::lib::progress_bar::ProgressBar;
use crate::lib::provider::get_network_context;
use crate::lib::waiter::create_waiter;

use clap::{App, Arg, ArgMatches, SubCommand};
Expand Down Expand Up @@ -44,11 +45,20 @@ fn create_canister(env: &dyn Environment, canister_name: &str) -> DfxResult {

let mut canister_id_store = CanisterIdStore::for_env(env)?;

let network_name = get_network_context()?;

let non_default_network = if network_name == "local" {
format!("")
} else {
format!("on network {:?} ", network_name)
};

match canister_id_store.find(&canister_name) {
Some(canister_id) => {
let message = format!(
"{:?} canister was already created and has canister id: {:?}",
"{:?} canister was already created {}and has canister id: {:?}",
canister_name,
non_default_network,
canister_id.to_text()
);
b.finish_with_message(&message);
Expand All @@ -58,8 +68,8 @@ fn create_canister(env: &dyn Environment, canister_name: &str) -> DfxResult {
let cid = runtime.block_on(mgr.create_canister(create_waiter()))?;
let canister_id = cid.to_text();
let message = format!(
"{:?} canister created with canister id: {:?}",
canister_name, canister_id
"{:?} canister created {}with canister id: {:?}",
canister_name, non_default_network, canister_id
);
b.finish_with_message(&message);
canister_id_store.add(&canister_name, canister_id)
Expand Down