forked from unixtools/custom-bitwarden
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·33 lines (30 loc) · 1.07 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh -x
echo "Building for '$BRAND' with suffix '$SUFFIX' and watermark '$LABEL'"
wget -N https://github.com/bitwarden/clients/releases/download/browser-v${VER}/dist-chrome-${VER}.zip
rm -rf browser${SUFFIX}
unzip -qd browser${SUFFIX} dist-chrome-${VER}.zip
rm dist-chrome-${VER}.zip
(cd browser${SUFFIX} && find . -type f -exec perl -pi -e 's/"Bitwarden"/"Bitwarden - '${BRAND}'"/go;' {} \;)
(cd browser${SUFFIX} && find . -type f -exec perl -pi -e 's/"Bitwarden - Free Password Manager"/"Bitwarden - '${BRAND}'"/go;' {} \;)
(cd browser${SUFFIX} && find . -type f -exec perl -pi -e 's{<title>Bitwarden</title>}{<title>Bitwarden - '${BRAND}'</title>}go;' {} \;)
rm -rf newimages
mkdir -p newimages
for file in browser${SUFFIX}/images/*; do
case $file in
*128)
pointsize="-pointsize 24"
;;
*32*|*38*|*48*)
pointsize="-pointsize 18"
;;
*16*|*18*|*19*)
pointsize="-pointsize 10"
;;
*)
pointsize=""
;;
esac
composite $pointsize label:"${LABEL}" -gravity NorthWest $file newimages/`basename $file`
done
cp newimages/* browser${SUFFIX}/images/
rm -rf newimages