Skip to content

Commit 923ecd6

Browse files
committed
0.4.2
1 parent 6899ae2 commit 923ecd6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "deltafy_logos-dev-cli-utils"
4-
version = "0.4.1"
4+
version = "0.4.2"
55

66
[lib]
77
crate-type = ["cdylib"]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deltafy/logos-dev-cli-utils",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"repository": "https://github.com/deltafy/logos-dev-cli-utils",

src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,14 @@ pub fn json_string_to_env(json_str: String, env_path: String) -> napi::Result<()
254254
))?;
255255

256256
for (key, value) in json_map {
257-
let val = value.as_str().unwrap_or("");
257+
let val = match value {
258+
serde_json::Value::String(s) => s.clone(),
259+
serde_json::Value::Number(n) => n.to_string(),
260+
serde_json::Value::Bool(b) => b.to_string(),
261+
serde_json::Value::Null => "".to_string(),
262+
_ => continue,
263+
};
264+
258265
writeln!(file, "{}={}", key, val)
259266
.map_err(|error| napi::Error::new(
260267
napi::Status::GenericFailure,

0 commit comments

Comments
 (0)