Smarter behaviour when piping data in with one argument

This commit is contained in:
Mike Farah
2022-01-27 10:18:46 +11:00
parent c3d815998a
commit fc276ff450
4 changed files with 18 additions and 2 deletions
+9
View File
@@ -10,6 +10,15 @@ testBasicEvalRoundTrip() {
assertEquals 123 "$X"
}
testBasicStdInWithOneArg() {
./yq e -n ".a = 123" > test.yml
X=$(cat test.yml | ./yq e ".a")
assertEquals 123 "$X"
X=$(cat test.yml | ./yq ea ".a")
assertEquals 123 "$X"
}
testBasicUpdateInPlaceSequence() {
cat >test.yml <<EOL
a: 0