use yq alternative syntax
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Robert Kaussow 2020-12-23 15:14:25 +01:00
parent 8ab4872091
commit 0a1b5b8623
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
2 changed files with 6 additions and 5 deletions

View File

@ -1,2 +1,3 @@
- BUGFIX
- Fix `yq` syntax after upgrade to v4
- ENHANCEMENT
- Update dependency mikefarah/yq to v4.1.0
- Use `yq` native alternative syntax

View File

@ -7,10 +7,10 @@ exec 5>&1
OUT=$(/usr/local/bin/lhci "$@" | tee /dev/fd/5) || ERROR=true
if [ -f "$CONFIG" ] && echo "$OUT" | grep -q "Done running Lighthouse"; then
UPLOAD_TARGET=$(yq e '.ci.upload.target' "${CONFIG}")
UPLOAD_OUTPUT_DIR=$(yq e '.ci.upload.outputDir' "${CONFIG}")
UPLOAD_TARGET=$(yq e '.ci.upload.target // ""' "${CONFIG}")
UPLOAD_OUTPUT_DIR=$(yq e '.ci.upload.outputDir // ""' "${CONFIG}")
if [ "${UPLOAD_TARGET}" = "filesystem" ] && [ "${UPLOAD_OUTPUT_DIR:-null}" != "null" ] ; then
if [ "${UPLOAD_TARGET}" = "filesystem" ] && [ -n "${UPLOAD_OUTPUT_DIR}" ] ; then
MANIFEST=${UPLOAD_OUTPUT_DIR%/}/manifest.json
DIST="${LHCI_BASE_DIR%/}/${UPLOAD_OUTPUT_DIR%/}/dist"
mkdir -p "${DIST}"