mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
1bd984d641
commit
e913281323
1 changed files with 3 additions and 4 deletions
7
yazi-core/src/external/jq.rs
vendored
7
yazi-core/src/external/jq.rs
vendored
|
|
@ -7,7 +7,7 @@ use yazi_shared::PeekError;
|
|||
|
||||
pub async fn jq(path: &Path, skip: usize, limit: usize) -> Result<String, PeekError> {
|
||||
let mut child = Command::new("jq")
|
||||
.args(["-C", "--indent", "-1", "."])
|
||||
.args(["-C", "--tab", "."])
|
||||
.arg(path)
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
|
|
@ -32,9 +32,8 @@ pub async fn jq(path: &Path, skip: usize, limit: usize) -> Result<String, PeekEr
|
|||
if lines.is_empty() {
|
||||
let mut stderr = child.stderr.take().unwrap();
|
||||
select! {
|
||||
Ok(_) = stderr.read_u8() => {
|
||||
return Err("parse error".into());
|
||||
}
|
||||
Ok(_) = stderr.read_u8() => return Err("parse error".into()),
|
||||
else => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue