Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
dzhou121 committed Apr 8, 2024
1 parent 6bf1324 commit 572aae8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.1.2"
version = "0.1.3"
edition = "2021"

[package]
Expand Down
8 changes: 7 additions & 1 deletion tiron/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ fn parse_runbook(name: &str, config: &Config, tx: &Sender<AppEvent>) -> Result<V
};
for seq in elements {
let mut hosts: Vec<Node> = Vec::new();
let mut name: Option<String> = None;

let Seq::Yield(Yield::Elem { value, span }) = seq else {
return Err(anyhow!("run should be a dict"));
Expand Down Expand Up @@ -116,11 +117,16 @@ fn parse_runbook(name: &str, config: &Config, tx: &Sender<AppEvent>) -> Result<V
}
}
}
} else if s.as_ref() == "name" {
let Expr::StringLit(s) = *value else {
return Err(anyhow!("run name should be a string"));
};
name = Some(s.to_string());
}
}
}
}
let run = Run::from_runbook(cwd, &data[span.start()..span.end()], hosts, tx)?;
let run = Run::from_runbook(cwd, name, &data[span.start()..span.end()], hosts, tx)?;
runs.push(run);
}

Expand Down
3 changes: 2 additions & 1 deletion tiron/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub struct Run {
impl Run {
pub fn from_runbook(
cwd: &Path,
name: Option<String>,
content: &str,
hosts: Vec<Node>,
tx: &Sender<AppEvent>,
Expand All @@ -43,7 +44,7 @@ impl Run {

let mut run = Run {
id: Uuid::new_v4(),
name: None,
name,
hosts,
};

Expand Down

0 comments on commit 572aae8

Please sign in to comment.