Skip to content

Commit

Permalink
Receive input byte stream
Browse files Browse the repository at this point in the history
  • Loading branch information
tesujimath committed Aug 22, 2024
1 parent 4749234 commit 7d3829f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,16 @@ impl PluginCommand for BashEnv {
))?,
};
let stdin = match input {
PipelineData::ByteStream(s, _metadata) => Some(s),
_ => None,
// TODO: pipe the stream into the subprocess rather than via a string
PipelineData::ByteStream(bytes, _metadata) => Some(bytes.into_string()?),
PipelineData::Value(Value::String { val: stdin, .. }, _metadata) => Some(stdin),
_ => {
debug!("PipelineData {:?}", input);
None
}
};

debug!("run path={:?} stdin={}", &path, stdin.is_some());
debug!("run path={:?} stdin={:?}", &path, stdin);

Ok(create_environment(span.unwrap_or(Span::unknown()), call.head).into_pipeline_data())
}
Expand Down

0 comments on commit 7d3829f

Please sign in to comment.