diff --git a/Cargo.lock b/Cargo.lock index 4855660..525d465 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,7 +72,7 @@ checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "deno_config" -version = "0.39.3" +version = "0.40.0" dependencies = [ "anyhow", "deno_package_json", diff --git a/Cargo.toml b/Cargo.toml index 5e2f77f..9735c68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "deno_config" description = "Config file implementation for the Deno CLI" -version = "0.39.3" +version = "0.40.0" edition = "2021" authors = ["the Deno authors"] license = "MIT" diff --git a/src/deno_json/mod.rs b/src/deno_json/mod.rs index 09b6379..63891e1 100644 --- a/src/deno_json/mod.rs +++ b/src/deno_json/mod.rs @@ -451,7 +451,7 @@ pub struct PatchConfigParseError(#[source] serde_json::Error); #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TaskDefinition { - pub command: String, + pub command: Option, #[serde(default)] pub dependencies: Vec, #[serde(default)] @@ -462,7 +462,7 @@ pub struct TaskDefinition { impl From<&str> for TaskDefinition { fn from(value: &str) -> Self { Self { - command: value.to_string(), + command: Some(value.to_string()), dependencies: vec![], description: None, } @@ -499,7 +499,7 @@ impl TaskDefinition { { let task_def = match value { serde_json::Value::String(command) => TaskDefinition { - command, + command: Some(command), dependencies: Vec::new(), description: None, }, @@ -1734,7 +1734,7 @@ mod tests { tasks_config["client"], TaskDefinition { description: Some("Build client project".to_string()), - command: "deno run -A client.js".to_string(), + command: Some("deno run -A client.js".to_string()), dependencies: vec!["build".to_string()] } );