mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-08 11:01:47 +01:00
with println
This commit is contained in:
parent
4a4c03f3c2
commit
d1726a052a
@ -89,17 +89,22 @@ impl InnerCliSession {
|
|||||||
std::thread::spawn(move || {
|
std::thread::spawn(move || {
|
||||||
let stdout_bufr = BufReader::new(stdout);
|
let stdout_bufr = BufReader::new(stdout);
|
||||||
for line in stdout_bufr.lines() {
|
for line in stdout_bufr.lines() {
|
||||||
let out = line.unwrap();
|
let out = line.as_ref().unwrap();
|
||||||
if let Ok(conn) = serde_json::from_str::<ConnectParams>(&out) {
|
if let Ok(conn) = serde_json::from_str::<ConnectParams>(&out) {
|
||||||
sender.send(conn).unwrap();
|
sender.send(conn).unwrap();
|
||||||
}
|
}
|
||||||
|
if let Ok(line) = line {
|
||||||
|
println!("dagger: {}", line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
std::thread::spawn(|| {
|
std::thread::spawn(|| {
|
||||||
let stderr_bufr = BufReader::new(stderr);
|
let stderr_bufr = BufReader::new(stderr);
|
||||||
for line in stderr_bufr.lines() {
|
for line in stderr_bufr.lines() {
|
||||||
let out = line.unwrap();
|
if let Ok(line) = line {
|
||||||
|
println!("dagger: {}", line);
|
||||||
|
}
|
||||||
//panic!("could not start dagger session: {}", out)
|
//panic!("could not start dagger session: {}", out)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
13
crates/dagger-sdk/examples/first-pipeline/main.rs
Normal file
13
crates/dagger-sdk/examples/first-pipeline/main.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
fn main() -> eyre::Result<()> {
|
||||||
|
let client = dagger_sdk::client::connect()?;
|
||||||
|
|
||||||
|
let version = client
|
||||||
|
.container(None)
|
||||||
|
.from("golang:1.19".into())
|
||||||
|
.with_exec(vec!["go".into(), "version".into()], None)
|
||||||
|
.stdout();
|
||||||
|
|
||||||
|
println!("Hello from Dagger and {}", version.trim());
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user