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
This commit is contained in:
a1346054 2021-09-21 04:17:46 +00:00 committed by GitHub
parent 9aec84dee7
commit e3c7b570ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 93 additions and 98 deletions

View File

@ -85,4 +85,3 @@ Standard: Cpp11
TabWidth: 4 TabWidth: 4
UseTab: Never UseTab: Never
... ...

View File

@ -63,7 +63,7 @@ Before submitting a bug report, check if the problem has already been reported.
### Discuss with the team ### Discuss with the team
As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, or in the IRC channel on Freenode (`#keepassxc-dev` on `irc.freenode.net`, or use a [webchat link](https://webchat.freenode.net/?channels=%23keepassxc-dev)). As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, on the [Matrix development channel](https://matrix.to/#/!RhJPJPGwQIFVQeXqZa:matrix.org?via=matrix.org), or in the IRC channel on Libera.Chat (`#keepassxc-dev` on `irc.libera.chat`, or use a [webchat link](https://web.libera.chat/#keepassxc-dev)).
### Your first code contribution ### Your first code contribution

View File

@ -1,8 +1,7 @@
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.
@ -646,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail. Also add information on how to contact you by electronic and paper mail.
@ -665,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school, You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>. <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>. <https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be author's reputation will not be affected by problems that might be
introduced by others. introduced by others.
Finally, software patents pose a constant threat to the existence of Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a effectively restrict the users of a free program by obtaining a
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The "work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must former contains code derived from the library, whereas the latter must
be combined with the library in order to run. be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@ -158,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy, You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a and you may at your option offer warranty protection in exchange for a
fee. fee.
2. You may modify your copy or copies of the Library or any portion 2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1 distribute such modifications or work under the terms of Section 1
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in that version instead if you wish.) Do not make any other change in
these notices. these notices.
Once this change is made in a given copy, it is irreversible for Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy. subsequent copies and derivative works made from that copy.
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6. distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6, Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself. whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or 6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work work containing portions of the Library, and distribute that work
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you use both them and the Library together in an executable that you
distribute. distribute.
7. You may place library facilities that are a work based on the 7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined facilities not covered by this License, and distribute such a combined
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein. restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with You are not responsible for enforcing compliance by third parties with
this License. this License.
11. If, as a consequence of a court judgment or allegation of patent 11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues), infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or conditions are imposed on you (whether by court order, agreement or
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by license version number, you may choose any version ever published by
the Free Software Foundation. the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free 14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these, programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is write to the author to ask for permission. For software which is
@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES. DAMAGES.
END OF TERMS AND CONDITIONS END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest If you develop a new library, and you want it to be of the greatest

View File

@ -1,7 +1,7 @@
GNU LESSER GENERAL PUBLIC LICENSE GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007 Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed. of this license document, but changing it is not allowed.

View File

@ -48,7 +48,7 @@ Detailed instructions are available in the [Build and Install](./INSTALL.md) pag
## Contributing ## Contributing
We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub or join us on IRC in [freenode](https://webchat.freenode.net/) channels #keepassxc and #keepassxc-dev. We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub, or join us on [Matrix community channel](https://matrix.to/#/!zUxwGnFkUyycpxeHeM:matrix.org?via=matrix.org) or [Matrix development channel](https://matrix.to/#/!RhJPJPGwQIFVQeXqZa:matrix.org?via=matrix.org), or on IRC in [Libera.Chat](https://web.libera.chat/) channels #keepassxc and #keepassxc-dev.
You may directly contribute your own code by submitting a pull request. Please read the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information. You may directly contribute your own code by submitting a pull request. Please read the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information.

View File

@ -47,4 +47,3 @@ mark_as_advanced(
Readline_INCLUDE_DIR Readline_INCLUDE_DIR
Readline_LIBRARY Readline_LIBRARY
) )

View File

@ -62,7 +62,7 @@ printUsage() {
cmd="COMMAND" cmd="COMMAND"
fi fi
printf "\e[1mUsage:\e[0m $(basename $0) $cmd [options]\n" printf "\e[1mUsage:\e[0m $(basename "$0") $cmd [options]\n"
if [ "COMMAND" == "$cmd" ]; then if [ "COMMAND" == "$cmd" ]; then
cat << EOF cat << EOF

View File

@ -18,4 +18,4 @@ minify -o icons/database --match=.svg icons/database
# Crush PNG's # Crush PNG's
echo "Crushing PNG's..." echo "Crushing PNG's..."
find "." -iname '*png' -exec pngcrush -ow -brute {} \; find . -iname '*.png' -exec pngcrush -ow -brute {} \;

View File

@ -16,23 +16,23 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
BASEDIR="$(dirname $0)" BASEDIR=$(dirname "$0")
PUSH=true PUSH=true
PULL=true PULL=true
UPDATE=true UPDATE=true
if [ "$1" == "push" ]; then if [[ $1 == "push" ]]; then
PULL=false PULL=false
elif [ "$1" == "pull" ]; then elif [[ $1 == "pull" ]]; then
PUSH=false PUSH=false
UPDATE=false UPDATE=false
elif [ "$1" == "update" ]; then elif [[ $1 == "update" ]]; then
PUSH=false PUSH=false
PULL=false PULL=false
elif [ "$1" != "" ]; then elif [[ $1 != "" ]]; then
echo "Unknown command '${1}'" echo "Unknown command '${1}'"
echo "Usage: $(basename $0) [update|pull|push] [additional tx options]" echo "Usage: $(basename "$0") [update|pull|push] [additional tx options]"
exit 1 exit 1
fi fi
@ -45,7 +45,7 @@ if $UPDATE; then
LUPDATE=lupdate-qt5 LUPDATE=lupdate-qt5
command -v $LUPDATE > /dev/null command -v $LUPDATE > /dev/null
if [ $? -ne 0 ]; then if [[ $? -ne 0 ]]; then
LUPDATE=lupdate LUPDATE=lupdate
fi fi
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete src -ts share/translations/keepassx_en.ts $LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete src -ts share/translations/keepassx_en.ts

View File

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

View File

@ -8,4 +8,3 @@ apps:
_app_name_: _app_name_:
command: foo-launch bar-launch _app_command_ command: foo-launch bar-launch _app_command_
``` ```

View File

@ -4,10 +4,10 @@
### change the path to suit your installation or set KDBX_SEARCH before calling ### ### change the path to suit your installation or set KDBX_SEARCH before calling ###
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx} : ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
PROG="${0##*/}" PROG=${0##*/}
KEEPASSXC=$(which -a keepassxc | sed -e "\\,$0,d" -e 'q') KEEPASSXC=$(which -a keepassxc | sed -e "\\,$0,d" -e 'q')
function daemon_main { daemon_main() {
# open kdewallet # open kdewallet
handle=$(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.open kdewallet 0 "$PROG") handle=$(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.open kdewallet 0 "$PROG")
while [[ true != $(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.isOpen kdewallet) ]]; do while [[ true != $(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.isOpen kdewallet) ]]; do
@ -27,7 +27,7 @@ function daemon_main {
qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.close "$handle" "false" "$PROG" qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.close "$handle" "false" "$PROG"
} }
if [[ '-d' = "$1" ]]; then if [[ $1 == '-d' ]]; then
exec >&~/tmp/$PROG.log exec >&~/tmp/$PROG.log
set -vx set -vx
daemon_main daemon_main

View File

@ -4,10 +4,10 @@
### change the path to suit your installation or set KDBX_SEARCH before calling ### ### change the path to suit your installation or set KDBX_SEARCH before calling ###
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx} : ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
PROG="$(basename $0)" PROG=$(basename "$0")
KeePassXC=$(ls -f {/usr/local,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1) KeePassXC=$(ls -f {/usr/local,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1)
function daemon_main { daemon_main() {
declare -A DBs declare -A DBs
for DBPATH in $KDBX_SEARCH; do for DBPATH in $KDBX_SEARCH; do
DBs[$(python -c "import os; print os.path.realpath('$DBPATH')")]=$(security find-generic-password -a $USER -s "${DBPATH##*/}" -w) DBs[$(python -c "import os; print os.path.realpath('$DBPATH')")]=$(security find-generic-password -a $USER -s "${DBPATH##*/}" -w)
@ -18,7 +18,7 @@ function daemon_main {
$KeePassXC --pw-stdin "${!DBs[@]}" <<<"${DBs[*]}" & $KeePassXC --pw-stdin "${!DBs[@]}" <<<"${DBs[*]}" &
} }
if [[ '-d' = "$1" ]]; then if [[ $1 == '-d' ]]; then
exec >&~/tmp/$PROG.log exec >&~/tmp/$PROG.log
set -vx set -vx
daemon_main daemon_main

View File

@ -118,9 +118,9 @@ BROWSER=$(whiptail \
clear clear
exitstatus=$? exitstatus=$?
if [ $exitstatus = 0 ]; then if [[ $exitstatus == 0 ]]; then
# Configure settings for the chosen browser # Configure settings for the chosen browser
case "$BROWSER" in case $BROWSER in
1) setupFirefox ;; 1) setupFirefox ;;
2) setupChrome ;; 2) setupChrome ;;
3) setupChromium ;; 3) setupChromium ;;
@ -132,7 +132,7 @@ if [ $exitstatus = 0 ]; then
# Install the JSON file # Install the JSON file
cd ~ cd ~
mkdir -p "$INSTALL_DIR" mkdir -p "$INSTALL_DIR"
echo "$JSON_OUT" > ${INSTALL_DIR}/${INSTALL_FILE} echo "$JSON_OUT" > "${INSTALL_DIR}/${INSTALL_FILE}"
whiptail \ whiptail \
--title "Installation Complete" \ --title "Installation Complete" \

View File

@ -42,22 +42,22 @@ NC='\033[0m'
RED='\033[0;31m' RED='\033[0;31m'
YELLOW='\033[0;33m' YELLOW='\033[0;33m'
if [ $# != 1 ];then if [[ $# != 1 ]]; then
echo "Usage: $0 MATERIAL" echo "Usage: $0 MATERIAL"
echo "MATERIAL is the directory containing the material icons repository" echo "MATERIAL is the directory containing the material icons repository"
echo "(git clone https://github.com/Templarian/MaterialDesign.git)". echo "(git clone https://github.com/Templarian/MaterialDesign.git)".
exit exit
fi fi
MATERIAL="$1" MATERIAL=$1
if [ ! -d "$MATERIAL" ];then if [[ ! -d $MATERIAL ]]; then
echo -e "${RED}Material Icons directory does not exist: ${MATERIAL}${NC}" echo -e "${RED}Material Icons directory does not exist: ${MATERIAL}${NC}"
exit 1 exit 1
fi fi
# Check destination dir # Check destination dir
DSTDIR=share/icons/application DSTDIR=share/icons/application
if [ ! -d "$DSTDIR" ];then if [[ ! -d $DSTDIR ]]; then
echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}" echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
exit 1 exit 1
fi fi
@ -69,7 +69,7 @@ fi
# extension, e. g. "folder-plus") to stdout. # extension, e. g. "folder-plus") to stdout.
# If the icon name is unknown, outputs nothing. # If the icon name is unknown, outputs nothing.
map() { map() {
case "$1" in case $1 in
application-exit) echo exit-run ;; application-exit) echo exit-run ;;
auto-type) echo keyboard-variant ;; auto-type) echo keyboard-variant ;;
bugreport) echo bug-outline ;; bugreport) echo bug-outline ;;
@ -148,27 +148,27 @@ map() {
} }
# Now do the actual work # Now do the actual work
find $DSTDIR -type f -name "*.svg" | while read -r DST;do find "$DSTDIR" -type f -name "*.svg" | while read -r DST; do
# Find the icon name (base name without extender) # Find the icon name (base name without extender)
NAME=$(basename $DST .svg) NAME=$(basename "$DST" .svg)
# Find the base name of the svg file for this icon # Find the base name of the svg file for this icon
MAT=$(map $NAME) MAT=$(map "$NAME")
if [[ -z $MAT ]];then if [[ -z $MAT ]]; then
echo -e "${YELLOW}Warning: No MaterialDesign mapping for ${NAME}${NC}" echo -e "${YELLOW}Warning: No MaterialDesign mapping for ${NAME}${NC}"
continue continue
fi fi
# So the source file is: # So the source file is:
SRC="$MATERIAL/svg/$MAT.svg" SRC="$MATERIAL/svg/$MAT.svg"
if [ ! -f "$SRC" ];then if [[ ! -f $SRC ]]; then
echo -e "${RED}Error: Source for ${NAME} doesn't exist: ${SRC}${NC}" echo -e "${RED}Error: Source for ${NAME} doesn't exist: ${SRC}${NC}"
continue continue
fi fi
# Replace the icon file with the source file # Replace the icon file with the source file
cp "$SRC" "$DST" || exit cp -- "$SRC" "$DST" || exit
echo "Copied icon for ${NAME}" echo "Copied icon for ${NAME}"
done done

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Assemble database icons from the icons8 collection # Assemble database icons from the icons8 collection
# by Wolfram Rösler 2020-04-30 # by Wolfram Rösler 2020-04-30
@ -7,7 +7,7 @@ RED='\033[0;31m'
YELLOW='\033[0;33m' YELLOW='\033[0;33m'
# Check parameters # Check parameters
if [[ $# != 1 ]];then if [[ $# != 1 ]]; then
echo "Usage: $0 ICONS8" echo "Usage: $0 ICONS8"
echo "ICONS8 is the directory containing the Icons8 flat-color-icons repository" echo "ICONS8 is the directory containing the Icons8 flat-color-icons repository"
echo "(git clone https://github.com/icons8/flat-color-icons)". echo "(git clone https://github.com/icons8/flat-color-icons)".
@ -15,15 +15,15 @@ if [[ $# != 1 ]];then
fi fi
# Check source directory # Check source directory
SRCDIR="$1" SRCDIR=$1
if [ ! -d "$SRCDIR" ];then if [[ ! -d $SRCDIR ]]; then
echo -e "${RED}icons8 directory doesn't exist: ${SRCDIR}${NC}" echo -e "${RED}icons8 directory doesn't exist: ${SRCDIR}${NC}"
exit 1 exit 1
fi fi
# Check destination directory # Check destination directory
DSTDIR=share/icons/database DSTDIR=share/icons/database
if [ ! -d "$DSTDIR" ];then if [[ ! -d $DSTDIR ]]; then
echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}" echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
exit 1 exit 1
fi fi
@ -39,7 +39,7 @@ fi
copy() { copy() {
# The source file is: # The source file is:
SRC="${SRCDIR}/svg/${1}.svg" SRC="${SRCDIR}/svg/${1}.svg"
if [ ! -f "$SRC" ];then if [[ ! -f $SRC ]]; then
echo -e "${RED}Cannot find source icon for ${2} (${SRC})${NC}" echo -e "${RED}Cannot find source icon for ${2} (${SRC})${NC}"
return return
fi fi
@ -47,7 +47,7 @@ copy() {
# Copy the source file to the destination, keeping # Copy the source file to the destination, keeping
# the source file's extension # the source file's extension
DST="$DSTDIR/${2}.svg" DST="$DSTDIR/${2}.svg"
cp $SRC $DST cp -- "$SRC" "$DST"
echo "Copied icon for ${1} to ${DST}" echo "Copied icon for ${1} to ${DST}"
} }