Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(task): support optional command #144

Merged
merged 1 commit into from
Dec 2, 2024
Merged
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
8 changes: 4 additions & 4 deletions src/deno_json/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
#[serde(default)]
pub dependencies: Vec<String>,
#[serde(default)]
Expand All @@ -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,
}
Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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()]
}
);
Expand Down