cat <directory> ignores QSV_SKIP_FORMAT_CHECK
Describe the bug When using the cat command with a directory as input, qsv will ignore the QSV_SKIP_FORMAT_CHECK and output the following error message if no valid file is in the directory:
No data on stdin. Please provide at least one input file or pipe data to stdin.
If there exists at least one valid file, the command will execute without error and ignore all invalid files.
This behavior was not present in version 4.0.0 but is present in 5.0.3.
I would suspect the issue was introduced in 86ca5a66ad82fc6598811934eafb3785d7abb442.
Probably affects anything that uses process_input (I don't know Rust so take it with a grain of salt).
To Reproduce Steps to reproduce the behavior:
- Create a test folder with an invalid file (e.g. test.txt)
- Set
QSV_SKIP_FORMAT_CHECK=1 - Run
qsv cat rows <directory>
PS > $null = New-Item -Path 'test/test.txt' -Force
PS > 'col_name' > 'test/test.txt'
PS > $env:QSV_SKIP_FORMAT_CHECK = 1
PS > qsv --version
qsv 5.0.3-mimalloc-apply;fetch;foreach;geocode;Luau 0.663;prompt;to;polars-0.48.1:release;self_update-16-16;25.34 GiB-4.71 GiB-13.55 GiB-31.67 GiB (x86_64-pc-windows-msvc compiled with Rust 1.87) prebuilt
PS > qsv --envlist
QSV_SKIP_FORMAT_CHECK: "1"
PS > qsv cat rows .\test
No data on stdin. Please provide at least one input file or pipe data to stdin.
PS > qsv cat rows .\test\test.txt
col_name
Expected behavior
PS > qsv cat rows .\test
col_name
PS > qsv cat rows .\test\test.txt
col_name
Thanks for the detailed report @allen-chin .
Your diagnosis was spot on and made the fix trivial.