Change string markings for replacements

This commit is contained in:
smdyv
2023-07-13 16:51:50 +02:00
committed by Daniel Micay
parent 0a1c6a0dbb
commit 4430036ea2
26 changed files with 231 additions and 231 deletions

View File

@@ -49,14 +49,14 @@ for file in static-tmp/**/*.css static-tmp/js/*.js static-tmp/**/!(bimi|favicon)
dest="$(dirname $file)/$hash.$(basename $file)"
if [[ $file == *.css ]]; then
replace+=";s@{{css|/${file#*/}}}@<link rel=\"stylesheet\" href=\"/${dest#*/}\" integrity=\"$sri_hash\"/>@g"
replace+=";s@\[\[css|/${file#*/}\]\]@<link rel=\"stylesheet\" href=\"/${dest#*/}\" integrity=\"$sri_hash\"/>@g"
elif [[ $file == *.js ]]; then
replace+=";s@{{js|/${file#*/}}}@<script type=\"module\" src=\"/${dest#*/}\" integrity=\"$sri_hash\"></script>@g"
replace+=";s@\[\[js|/${file#*/}\]\]@<script type=\"module\" src=\"/${dest#*/}\" integrity=\"$sri_hash\"></script>@g"
fi
mv "$file" "$dest"
replace+=";s@{{integrity|/${file#*/}}}@${sri_hash}@g"
replace+=";s@{{path|/${file#*/}}}@/${dest#*/}@g"
replace+=";s@\[\[integrity|/${file#*/}\]\]@${sri_hash}@g"
replace+=";s@\[\[path|/${file#*/}\]\]@/${dest#*/}@g"
done
sed -i "$replace" static-tmp/**/*.html nginx-tmp/nginx.conf nginx-tmp/snippets/preload.conf
@@ -67,7 +67,7 @@ for device in ${devices[@]}; do
for channel in ${channels[@]}; do
metadata=$(curl -s $RELEASES_BASE/$device-$channel)
build_number=$(echo -n $metadata | cut -d ' ' -f 1)
replace+=";s@{{$device-$channel-BUILD_NUMBER}}@$build_number@g"
replace+=";s@\[\[$device-$channel-BUILD_NUMBER\]\]@$build_number@g"
done
done
sed -i "$replace" static-tmp/releases.html