Can shebang yq scripts! #1851

This commit is contained in:
Mike Farah
2024-02-16 10:48:07 +11:00
parent 047694546c
commit 86bb90f989
4 changed files with 39 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
setUp() {
rm test*.yq || true
cat >test.yq <<EOL
#!./yq
.a.b
EOL
chmod +x test.yq
rm test*.yml || true
cat >test.yml <<EOL
a: {b: apple}
EOL
}
testCanExecYqFile() {
read -r -d '' expected << EOM
apple
EOM
X=$(./test.yq test.yml)
assertEquals "$expected" "$X"
}
source ./scripts/shunit2