mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Fixed bug - ignore path expressions that match a directory
This commit is contained in:
parent
926a68181b
commit
5ac3c57510
@ -10,6 +10,12 @@ testBasicEvalRoundTrip() {
|
||||
assertEquals 123 "$X"
|
||||
}
|
||||
|
||||
testBasicPipeWithDot() {
|
||||
./yq -n ".a = 123" > test.yml
|
||||
X=$(cat test.yml | ./yq '.')
|
||||
assertEquals 123 "$X"
|
||||
}
|
||||
|
||||
testBasicEvalRoundTripNoEval() {
|
||||
./yq -n ".a = 123" > test.yml
|
||||
X=$(./yq '.a' test.yml)
|
||||
|
@ -98,6 +98,6 @@ func configureEncoder(format yqlib.PrinterOutputFormat) yqlib.Encoder {
|
||||
// without this - yq detects there is stdin (thanks githubactions),
|
||||
// then tries to parse the filename as an expression
|
||||
func maybeFile(str string) bool {
|
||||
_, err := os.Stat(str) // #nosec
|
||||
return err == nil
|
||||
stat, err := os.Stat(str) // #nosec
|
||||
return err == nil && !stat.IsDir()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user