From 2dfb0f277f7b6fda1031d49523b7288371b9e0da Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Fri, 21 May 2021 15:44:29 +0200 Subject: [PATCH] chore: fix script formatting --- overlay/usr/bin/lhci | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/overlay/usr/bin/lhci b/overlay/usr/bin/lhci index 0aa3d25..52f94dd 100755 --- a/overlay/usr/bin/lhci +++ b/overlay/usr/bin/lhci @@ -10,16 +10,16 @@ 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}") - if [ "${UPLOAD_TARGET}" = "filesystem" ] && [ -n "${UPLOAD_OUTPUT_DIR}" ] ; 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}" if [ -f "$CONFIG" ]; then - cp /templates/summary.md "${DIST}/summary.md" + cp /templates/summary.md "${DIST}/summary.md" printf "\nPost-process report files...\n" - for ITEM in $(jq -r '.[] | select( .isRepresentativeRun == true ) | @base64' < "${MANIFEST}"); do + for ITEM in $(jq -r '.[] | select( .isRepresentativeRun == true ) | @base64' <"${MANIFEST}"); do JSON=$(echo "${ITEM}" | base64 -d) FILE_DATE=$(date '+%Y%m%d%H%M') @@ -38,7 +38,7 @@ if [ -f "$CONFIG" ] && echo "$OUT" | grep -q "Done running Lighthouse"; then cp "${FILENAME}" "${DIST}/${FILENAME_NEW}.html" echo "Report for ${URL} will be uploaded to ${DOWNLOAD}" - echo "| [Link]("${DOWNLOAD}") | \`${URL}\` | $(echo "scale=0;($PERF*100)/1" | bc) % | $(echo "scale=0;($ACCESS*100)/1" | bc) % | $(echo "scale=0;($PRACTICE*100)/1" | bc) % | $(echo "scale=0;($SEO*100)/1" | bc) % | $(echo "scale=0;($PWA*100)/1" | bc) % |" >> "${DIST}/summary.md" + echo "| [Link](${DOWNLOAD}) | \`${URL}\` | $(echo "scale=0;($PERF*100)/1" | bc) % | $(echo "scale=0;($ACCESS*100)/1" | bc) % | $(echo "scale=0;($PRACTICE*100)/1" | bc) % | $(echo "scale=0;($SEO*100)/1" | bc) % | $(echo "scale=0;($PWA*100)/1" | bc) % |" >>"${DIST}/summary.md" done else printf "\nPost-processing skipped. Manifest not found!\n"