From 5968c1915dc2407127639bfbea72edf6854a18ef Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Sat, 21 Jul 2018 22:10:48 +0200 Subject: [PATCH] Fixes Inkscape detection under MSYS2, #4469 --- tools/generatePngIcons | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/generatePngIcons b/tools/generatePngIcons index aa39ca0ca..a26c6dc08 100755 --- a/tools/generatePngIcons +++ b/tools/generatePngIcons @@ -20,9 +20,16 @@ mkdir "$tmpDir" || exit 1 outDir="$tmpDir" # Abort if Inkscape is not installed: -if ! command -v inkscape >/dev/null; then - printf '%s\n' "Inkscape does not appear to be installed. Aborting." - exit 1 +if [[ ${OSTYPE^^} = "MSYS" ]]; then + if ! command -v "/c/Program Files/Inkscape/inkscape.exe" >/dev/null; then + printf '%s\n' "Inkscape does not appear to be installed. Aborting." + exit 1 + fi +else + if ! command -v inkscape >/dev/null; then + printf '%s\n' "Inkscape does not appear to be installed. Aborting." + exit 1 + fi fi # Command-line arguments: @@ -112,7 +119,7 @@ convertSvg() { --skip-if-larger \ "$1" sizeAfter=$(wc -c < "$1") - printf 'Filesize fefore: %s After: %s Difference: %s\n' "$sizeBefore" "$sizeAfter" "$((sizeBefore - sizeAfter))" + printf 'Filesize before: %s After: %s Difference: %s\n' "$sizeBefore" "$sizeAfter" "$((sizeBefore - sizeAfter))" fi }