g.download.location: Print target path in error message#4155
g.download.location: Print target path in error message#4155echoix merged 4 commits intoOSGeo:mainfrom neteler:g_download_location_target_path
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 <[email protected]>
|
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. |
veroandreo
left a comment
There was a problem hiding this comment.
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 <[email protected]>
* 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 <[email protected]>
* database -> project
Co-authored-by: Veronica Andreo <[email protected]>
---------
Co-authored-by: Vaclav Petras <[email protected]>
Co-authored-by: Veronica Andreo <[email protected]>
* 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 <[email protected]>
* database -> project
Co-authored-by: Veronica Andreo <[email protected]>
---------
Co-authored-by: Vaclav Petras <[email protected]>
Co-authored-by: Veronica Andreo <[email protected]>
* 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 <[email protected]>
* database -> project
Co-authored-by: Veronica Andreo <[email protected]>
---------
Co-authored-by: Vaclav Petras <[email protected]>
Co-authored-by: Veronica Andreo <[email protected]>
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.