keepassxc/share/windows/create-ico.sh
a1346054 e3c7b570ae
Minor documentation and script cleanups (#6868)
* Remove mention of no longer used IRC network

Channels exist on matrix, and on libera.chat now.

* Correctly match only files with .png extension

The current search would match files such as 'createpng'.

* Fix comparison in script

The result was always false, due to comparing a literal string instead of a variable.

* Use correct license files from upstream

Correct license files obtained from:
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
https://www.gnu.org/licenses/gpl-3.0.txt
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
https://www.gnu.org/licenses/lgpl-3.0.txt

* Refresh several shell scripts

This fixes several shellcheck warnings, as well as makes the code more
robust and have consistent codestyle between all the files.

* Trim excess whitespace
2021-09-21 00:17:46 -04:00

32 lines
629 B
Bash

#!/usr/bin/env bash
NC='\033[0m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
if [[ -z $1 ]]; then
echo -e "${RED}You must include an SVG file to convert!${NC}"
exit 1
fi
outfile=$2
if [[ -z $outfile ]]; then
outfile="logo.ico"
fi
if ! command -v inkscape &> /dev/null; then
echo -e "${YELLOW}Could not find inkscape; $outfile not built!${NC}"
exit 0
fi
echo "Generating $outfile from $1..."
size_list=(16 24 32 48 64 128 256)
for size in "${size_list[@]}"; do
inkscape -z -e $size.png -w $size -h $size "$1" >/dev/null 2>/dev/null
done
images=$(printf "%s.png " "${size_list[@]}")
convert $images $outfile
rm $images