diff --git a/crates/dagger-core/src/cli_session.rs b/crates/dagger-core/src/cli_session.rs index 7901cdb..5cf9ed4 100644 --- a/crates/dagger-core/src/cli_session.rs +++ b/crates/dagger-core/src/cli_session.rs @@ -89,17 +89,22 @@ impl InnerCliSession { std::thread::spawn(move || { let stdout_bufr = BufReader::new(stdout); for line in stdout_bufr.lines() { - let out = line.unwrap(); + let out = line.as_ref().unwrap(); if let Ok(conn) = serde_json::from_str::(&out) { sender.send(conn).unwrap(); } + if let Ok(line) = line { + println!("dagger: {}", line); + } } }); std::thread::spawn(|| { let stderr_bufr = BufReader::new(stderr); 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) } }); diff --git a/crates/dagger-sdk/examples/first-pipeline/main.rs b/crates/dagger-sdk/examples/first-pipeline/main.rs new file mode 100644 index 0000000..3eccc36 --- /dev/null +++ b/crates/dagger-sdk/examples/first-pipeline/main.rs @@ -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(()) +}