make it work with docker

This commit is contained in:
Stefan Melmuk 2024-03-09 08:46:13 +01:00
parent 21ffad4495
commit 9b23b36860
No known key found for this signature in database
GPG key ID: 817020C608FE9C09
2 changed files with 14 additions and 22 deletions

View file

@ -1,6 +1,18 @@
#!/usr/bin/env bash
set -o pipefail -o errexit
function replace_embedded_svg_icon() {
if [ ! -f $1 ]; then echo "$1 does not exist"; exit -1; fi
if [ ! -f $2 ]; then echo "$2 does not exist"; exit -1; fi
echo "'$1' -> '$2'"
first='`$'
last='^`'
sed -i "/$first/,/$last/{ /$first/{p; r $1
}; /$last/p; d }" $2
}
# If a patch was not provided, try to choose one
if [[ -z ${PATCH_NAME} ]]; then
# If a patch with the same name as the ref exists, use it
@ -30,10 +42,10 @@ echo "Patching images"
cp -vfR ../resources/src/* ./apps/web/src/
echo "Patching logos"
../scripts/replace-embedded-svg-icons.sh \
replace_embedded_svg_icon \
../resources/vaultwarden-admin-console-logo.svg \
./apps/web/src/app/admin-console/icons/admin-console-logo.ts
../scripts/replace-embedded-svg-icons.sh \
replace_embedded_svg_icon \
../resources/vaultwarden-password-manager-logo.svg \
./apps/web/src/app/layouts/password-manager-logo.ts

View file

@ -1,20 +0,0 @@
#!/bin/bash
if [ ! -f $1 ]
then
echo "$1 does not exist"
exit -1
fi
if [ ! -f $2 ]
then
echo "$2 does not exist"
exit -1
fi
echo "'$1' -> '$2'"
first='`$'
last='^`'
sed -i "/$first/,/$last/{ /$first/{p; r $1
}; /$last/p; d }" $2