Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDAL tools using bash scripts don't work when the path to QGIS.app has spaces #174

Open
kidhanis opened this issue Sep 17, 2023 · 0 comments

Comments

@kidhanis
Copy link

QGIS version 3.32.2-Lima, running in MacOS 10.13.6. The app is installed in /Applications/My Tools/QGIS.app.

I'm trying to use Raster -> Miscellaneous -> Raster Information, which uses gdalinfo. Once I add an input layer and press Run, I get the following:
/Applications/My Tools/QGIS.app/Contents/MacOS/bin/gdalinfo: line 3: /Applications/My: No such file or directory
The path is stopping at the space in "My Tools". If I move QGIS to /Applications/QGIS.app then everything works fine.

The same error occurs if I run gdalinfo from /Applications/My Tools/QGIS.app/Contents/MacOS/bin/gdalinfo. In fact, the behavior seems to happen only with GDAL commands that first execute a bash script.

This is the script for gdalinfo, which might be created by QGIS-Mac-Packager/qgis_bundle/recipes/gdal/recipe.sh#L48-L50:

#!/bin/bash
THISDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
$THISDIR/run_gdal_binary.bash "gdalinfo" "$@"

The error can be fixed by adding quotes around $THISDIR in the last line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant