Fixes Inkscape detection under MSYS2, #4469

This commit is contained in:
Morgan Hardwood
2018-07-21 22:10:48 +02:00
parent 807c1da120
commit 5968c1915d

View File

@@ -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
}