Skip to content

Commit

Permalink
Update READMEs and tools
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Mar 16, 2021
1 parent 0b5066d commit 25764b9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
18 changes: 4 additions & 14 deletions crates/rune-modules/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ pub fn module(_stdio: bool) -> Result<Module, ContextError> {
module.async_inst_fn("wait_with_output", Child::wait_with_output)?;
module.inst_fn(Protocol::STRING_DISPLAY, ExitStatus::display)?;
module.inst_fn("code", ExitStatus::code)?;

module.field_fn(Protocol::INDEX_GET, "status", Output::status)?;
Ok(module)
}

Expand Down Expand Up @@ -127,7 +125,7 @@ impl Child {
};

Ok(Ok(Output {
status: output.status,
status: ExitStatus { status: output.status },
stdout: Shared::new(Bytes::from_vec(output.stdout)),
stderr: Shared::new(Bytes::from_vec(output.stderr)),
}))
Expand All @@ -136,23 +134,15 @@ impl Child {

#[derive(Any)]
struct Output {
status: std::process::ExitStatus,
#[rune(get)]
status: ExitStatus,
#[rune(get)]
stdout: Shared<Bytes>,
#[rune(get)]
stderr: Shared<Bytes>,
}

impl Output {
/// Get the exist status of the process.
fn status(&self) -> ExitStatus {
ExitStatus {
status: self.status,
}
}
}

#[derive(Any)]
#[derive(Clone, Copy, Any)]
struct ExitStatus {
status: std::process::ExitStatus,
}
Expand Down
3 changes: 3 additions & 0 deletions crates/rune-ssa/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# rune-ssa

The state machine assembler of Rune.
2 changes: 1 addition & 1 deletion tools/publish.rn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub async fn main() {

let status = select {
_ = ctrl_c => break,
status = cargo.spawn()? => status?,
output = cargo.spawn()?.wait_with_output() => output?.status,
};

println(`${project}: ${status}`);
Expand Down
2 changes: 1 addition & 1 deletion tools/readmes.rn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use process::Command;
async fn update_readme(project, output) {
let cargo = Command::new("cargo");
cargo.args(["readme", "-r", project, "-o", output, "-t", "../../README.tpl"]);
Ok(cargo.spawn()?.await?)
Ok(cargo.spawn()?.wait_with_output().await?.status)
}

pub async fn main() {
Expand Down

0 comments on commit 25764b9

Please sign in to comment.