diff --git a/radix-clis/src/scrypto/cmd_build.rs b/radix-clis/src/scrypto/cmd_build.rs index 085dc83643..e69241b169 100644 --- a/radix-clis/src/scrypto/cmd_build.rs +++ b/radix-clis/src/scrypto/cmd_build.rs @@ -124,7 +124,14 @@ impl Build { if let Some(env) = &self.env { let env_variables_decoded: Vec> = env .iter() - .map(|e| e.split('=').collect::>()) + .map(|e| + // Split string on the first '=' occurence. + // This is to cover cases like this: + // ENV_NAME=foo=bar + match e.split_once('=') { + Some((key, val)) => vec![key, val], + None => vec![e.as_str()], + }) .collect(); for v in env_variables_decoded { if v.len() == 1 { diff --git a/radix-clis/tests/scrypto.sh b/radix-clis/tests/scrypto.sh index f6a880ef6e..45e8f3d203 100755 --- a/radix-clis/tests/scrypto.sh +++ b/radix-clis/tests/scrypto.sh @@ -20,7 +20,7 @@ $scrypto new-package hello-world --path $test_pkg --local # # To test that the generated Cargo.lock is good, we run a build with the --locked command below. # This checks that the templated cargo lock is complete. -# +# # If this line fails, run ./update-cargo-locks-minimally.sh from the repo root to # regenerate the Cargo.lock_template which is used. $scrypto build --path $test_pkg --locked @@ -30,6 +30,9 @@ $scrypto test --path $test_pkg --locked $scrypto test --path $test_pkg --locked -- test_hello --nocapture $scrypto test --path $test_pkg --locked -- --nocapture + +$scrypto build --path ../examples/everything --env ENV_NAME=foo=bar + # Logging $scrypto build --path ../examples/everything --log-level ERROR --locked size1=$(ls -la ../examples/everything/target/wasm32-unknown-unknown/release/everything.wasm | cut -d ' ' -f 5) @@ -51,4 +54,4 @@ else fi # Clean up -rm -fr $test_pkg \ No newline at end of file +rm -fr $test_pkg