Skip to content

Commit c2b3750

Browse files
committed
read from stdin if - is specified
1 parent 9c7edb9 commit c2b3750

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ array-init = "2.1"
101101
arrow2 = "0.17"
102102
arrow2_convert = "0.5.0"
103103
async-executor = "1.0"
104+
atty = "0.2"
104105
backtrace = "0.3"
105106
bincode = "1.3"
106107
bitflags = { version = "2.4", features = ["bytemuck"] }

crates/re_data_source/src/data_source.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,16 @@ impl DataSource {
6969
}
7070
}
7171

72+
// Reading from standard input in non-TTY environments (e.g. Github Actions, but I'm sure we can
73+
// come up with more convoluted than that ...) can lead to many unexpected,
74+
// platform-specific problems that aren't even necessarily consistent across runs.
75+
//
76+
// In order to avoid having to swallow errors based on unreliable heuristics (or inversely:
77+
// throwing errors when we shouldn't), we just make reading from standard input explicit.
78+
if uri == "-" {
79+
return DataSource::Stdin;
80+
}
81+
7282
let path = std::path::Path::new(&uri).to_path_buf();
7383

7484
if uri.starts_with("file://") || path.exists() {

crates/rerun/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ pub mod external {
142142
pub use anyhow;
143143

144144
pub use re_build_info;
145+
pub use re_data_source;
145146
pub use re_data_store;
146147
pub use re_data_store::external::*;
147148
pub use re_format;

0 commit comments

Comments
 (0)