Skip to content

Commit

Permalink
Fixed absolute paths in ci command report
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjol committed Sep 30, 2024
1 parent 2529bfb commit 8216a92
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion commands/unlighthouse/unlighthouse-ci
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,19 @@
FOLDER=${1:-'local'}
FILE=${2:-'unlighthouse.ts'}

unlighthouse-ci --build-static --config-file=./config/$FOLDER/$FILE --output-path=./export/$FILE ${@:3}
REPORTS_FOLDER="./export"
pwd
replace_content_in_files() {
local folder=$1
local filter=$2
local search=$3
local replace=$4

find "${folder}" -name "${filter}" -type f -exec sed -i "s|${search}|${replace}|g" {} +
}

unlighthouse-ci --build-static --config-file=./config/$FOLDER/$FILE --output-path=./export/$FILE ${@:3}

replace_content_in_files "$REPORTS_FOLDER" "*.js" "/reports" "./reports"
replace_content_in_files "$REPORTS_FOLDER" "*.js" "/assets" "./assets"
replace_content_in_files "$REPORTS_FOLDER" "*.html" "/assets" "./assets"

0 comments on commit 8216a92

Please sign in to comment.