mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-06 03:25:23 +00:00
fix: add winapi-util
dependency for windows builds
This commit is contained in:
parent
df7020a7a8
commit
c70e675655
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -3104,7 +3104,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "television"
|
||||
version = "0.4.17"
|
||||
version = "0.4.18"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bat",
|
||||
@ -3216,6 +3216,7 @@ dependencies = [
|
||||
"lazy_static",
|
||||
"syntect",
|
||||
"tracing",
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "television"
|
||||
version = "0.4.17"
|
||||
version = "0.4.18"
|
||||
edition = "2021"
|
||||
description = "The revolution will be televised."
|
||||
license = "MIT"
|
||||
|
@ -24,3 +24,6 @@ bat = "0.24.0"
|
||||
directories = "5.0.1"
|
||||
syntect = "5.2.0"
|
||||
gag = "1.0.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
winapi-util = "0.1.9"
|
||||
|
@ -1,3 +1,6 @@
|
||||
#![allow(unused_imports)]
|
||||
use tracing::debug;
|
||||
|
||||
/// Heuristic to determine if stdin is readable.
|
||||
///
|
||||
/// This is used to determine if we should use the stdin channel.
|
||||
@ -32,7 +35,7 @@ pub fn is_readable_stdin() -> bool {
|
||||
let typ = match winapi_util::file::typ(stdin) {
|
||||
Ok(typ) => typ,
|
||||
Err(err) => {
|
||||
log::debug!(
|
||||
debug!(
|
||||
"for heuristic stdin detection on Windows, \
|
||||
could not get file type of stdin \
|
||||
(thus assuming stdin is not readable): {err}",
|
||||
@ -43,7 +46,7 @@ pub fn is_readable_stdin() -> bool {
|
||||
let is_disk = typ.is_disk();
|
||||
let is_pipe = typ.is_pipe();
|
||||
let is_readable = is_disk || is_pipe;
|
||||
log::debug!(
|
||||
debug!(
|
||||
"for heuristic stdin detection on Windows, \
|
||||
found that is_disk={is_disk} and is_pipe={is_pipe}, \
|
||||
and thus concluded that is_stdin_readable={is_readable}",
|
||||
@ -53,7 +56,7 @@ pub fn is_readable_stdin() -> bool {
|
||||
|
||||
#[cfg(not(any(unix, windows)))]
|
||||
fn imp() -> bool {
|
||||
log::debug!("on non-{{Unix,Windows}}, assuming stdin is not readable");
|
||||
debug!("on non-{{Unix,Windows}}, assuming stdin is not readable");
|
||||
false
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user