mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Don't automatically read stdin when the null input flag is used
This commit is contained in:
parent
90261a2fdd
commit
70ad7a35a8
@ -86,6 +86,12 @@ testBasicCatWithFilesNoDash() {
|
|||||||
assertEquals "$Y" "$X"
|
assertEquals "$Y" "$X"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# when the nullinput flag is used
|
||||||
|
# dont automatically read STDIN (this breaks github actions)
|
||||||
|
testBasicCreateFileGithubAction() {
|
||||||
|
cat /dev/null | ./yq -n ".a = 123" > test.yml
|
||||||
|
}
|
||||||
|
|
||||||
testBasicEvalAllCatWithFilesNoDash() {
|
testBasicEvalAllCatWithFilesNoDash() {
|
||||||
./yq -n ".a = 123" > test.yml
|
./yq -n ".a = 123" > test.yml
|
||||||
./yq -n ".a = 124" > test2.yml
|
./yq -n ".a = 124" > test2.yml
|
||||||
|
@ -126,7 +126,7 @@ func processStdInArgs(args []string) []string {
|
|||||||
// read from stdin.
|
// read from stdin.
|
||||||
// this happens if there is more than one argument
|
// this happens if there is more than one argument
|
||||||
// or only one argument and its a file
|
// or only one argument and its a file
|
||||||
if !pipingStdin || len(args) > 1 || (len(args) > 0 && maybeFile(args[0])) {
|
if nullInput || !pipingStdin || len(args) > 1 || (len(args) > 0 && maybeFile(args[0])) {
|
||||||
return args
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user