mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-20 08:18:24 +00:00
tools: check for yq before using it
as get_from_kata_deps may be called from scripts that does not install_yq Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
This commit is contained in:
@@ -36,6 +36,7 @@ get_from_kata_deps() {
|
|||||||
local dependency="$1"
|
local dependency="$1"
|
||||||
versions_file="${this_script_dir}/../../../versions.yaml"
|
versions_file="${this_script_dir}/../../../versions.yaml"
|
||||||
|
|
||||||
|
command -v yq &> /dev/null || die 'yq command is not in your $PATH'
|
||||||
result=$("yq" read -X "$versions_file" "$dependency")
|
result=$("yq" read -X "$versions_file" "$dependency")
|
||||||
[ "$result" = "null" ] && result=""
|
[ "$result" = "null" ] && result=""
|
||||||
echo "$result"
|
echo "$result"
|
||||||
|
Reference in New Issue
Block a user