Skip to content

Commit

Permalink
fix(node): Throw error on --dev in case of non-dev build (#3280)
Browse files Browse the repository at this point in the history
  • Loading branch information
breathx authored Sep 15, 2023
1 parent 80fb847 commit 30af614
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ examples-proc: wasm-proc-release

.PHONY: node
node:
@ ./scripts/gear.sh build node
@ ./scripts/gear.sh build node -F dev

.PHONY: node-release
node-release:
@ ./scripts/gear.sh build node --release
@ ./scripts/gear.sh build node -F dev --release

.PHONY: vara
vara:
Expand Down
2 changes: 2 additions & 0 deletions node/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ impl SubstrateCli for Cli {

fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
#[cfg(not(feature = "dev"))]
"dev" | "gear-dev" | "vara-dev" => return Err("Development runtimes are not available. Please compile the node with `-F dev` to enable it.".into()),
#[cfg(all(feature = "gear-native", feature = "dev"))]
"dev" | "gear-dev" => Box::new(chain_spec::gear::development_config()?),
#[cfg(all(feature = "vara-native", feature = "dev"))]
Expand Down

0 comments on commit 30af614

Please sign in to comment.