From 893e75f648b343ad9afc4c16bf13b64e608f9a26 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 16 Jun 2022 19:55:14 +0200 Subject: [PATCH] balena-lib: Use balena.yml if present Change-type: patch Signed-off-by: Alex Gonzalez --- automation/include/balena-lib.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/automation/include/balena-lib.inc b/automation/include/balena-lib.inc index 2d2531bef..d5a44f47f 100644 --- a/automation/include/balena-lib.inc +++ b/automation/include/balena-lib.inc @@ -98,7 +98,10 @@ __find_contract_by_slug() { local _contracts local _slug - _contracts=$(find "${device_dir}/contracts/" -name "contract.json" -print 2>/dev/null) + _contracts=$(find "${device_dir}" -maxdepth 1 -name "balena.yml" -print 2>/dev/null) + if [ -z "${_contracts}" ]; then + _contracts=$(find "${device_dir}/contracts/" -name "contract.json" -print 2>/dev/null) + fi for contract in ${_contracts}; do _slug=$(jq --raw-output .slug < "${contract}") if [ "${_slug}" = "${_tslug}" ]; then