-
-
Notifications
You must be signed in to change notification settings - Fork 308
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
g.download.location: Print target path in error message #4155
Conversation
To be less obscure (seen in addons CI log): ``` ERROR: Location named <nc_spm_full_v2alpha2> already exists, download canceled ``` where actually the existing Location is, this PR improves the error message: ``` g.download.location url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=$HOME ERROR: Location named <nc_spm_full_v2alpha2> already exists in </home/mneteler/nc_spm_full_v2alpha2>, download canceled ```
(I came across this issue while locally testing https://github.com/OSGeo/grass-addons/blob/grass8/.github/workflows/test.sh) |
Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com>
Slightly related, but the same problem: I read the docs of g.download.location the other day, and it seems there isn't a way to either download if missing, or to not fail if the same dataset already exists. If it was possible, it would allow for example to use the script test_thorough.sh in the CI, and run it locally multiple times, instead of being able to run it once, then to adapt and only copy the second invocation. At least this PR improves by showing more info as to where the data already exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NC sample datasets are projects. I'd avoid calling them databases since usually the grassdata folder (a folder of projects) is called database. Also included a suggestion for @wenzeslaus' comment.
Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
* g.download.location: print target path in error message To be less obscure in case the target location directory already exists: ``` ERROR: Location named <nc_spm_full_v2alpha2> already exists, download canceled ``` this PR improves the error message to include the path: ``` g.download.location url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=$HOME ERROR: Location named <nc_spm_full_v2alpha2> already exists in </home/mneteler/nc_spm_full_v2alpha2>, download canceled ``` This is esp. relevant for scripted usage when the command isn't invoked directly by the user. In addition, section of **EXAMPLES** added. * fix message format Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com> * database -> project Co-authored-by: Veronica Andreo <veroandreo@gmail.com> --------- Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com> Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
* g.download.location: print target path in error message To be less obscure in case the target location directory already exists: ``` ERROR: Location named <nc_spm_full_v2alpha2> already exists, download canceled ``` this PR improves the error message to include the path: ``` g.download.location url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=$HOME ERROR: Location named <nc_spm_full_v2alpha2> already exists in </home/mneteler/nc_spm_full_v2alpha2>, download canceled ``` This is esp. relevant for scripted usage when the command isn't invoked directly by the user. In addition, section of **EXAMPLES** added. * fix message format Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com> * database -> project Co-authored-by: Veronica Andreo <veroandreo@gmail.com> --------- Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com> Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
* g.download.location: print target path in error message To be less obscure in case the target location directory already exists: ``` ERROR: Location named <nc_spm_full_v2alpha2> already exists, download canceled ``` this PR improves the error message to include the path: ``` g.download.location url=https://grass.osgeo.org/sampledata/north_carolina/nc_spm_full_v2alpha2.tar.gz path=$HOME ERROR: Location named <nc_spm_full_v2alpha2> already exists in </home/mneteler/nc_spm_full_v2alpha2>, download canceled ``` This is esp. relevant for scripted usage when the command isn't invoked directly by the user. In addition, section of **EXAMPLES** added. * fix message format Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com> * database -> project Co-authored-by: Veronica Andreo <veroandreo@gmail.com> --------- Co-authored-by: Vaclav Petras <wenzeslaus@gmail.com> Co-authored-by: Veronica Andreo <veroandreo@gmail.com>
To be less obscure in case the target location directory already exists:
this PR improves the error message to include the path:
This is esp. relevant for scripted usage when the command isn't invoked directly by the user.
In addition, section of EXAMPLES added.