Skip to content

Commit

Permalink
grass.script: Use full env always in create_project
Browse files Browse the repository at this point in the history
For reporting errors the g.message tool is called, so the environment setup is always needed (except when doing XY without errors).
  • Loading branch information
wenzeslaus committed May 3, 2024
1 parent a351e5e commit fc22660
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/grass/script/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1760,11 +1760,11 @@ def create_project(
env = os.environ.copy()
setup_runtime_env(env=env)

if epsg or proj4 or filename or wkt:
# The names don't really matter here.
tmp_gisrc, env = create_environment(
mapset_path.directory, mapset_path.location, mapset_path.mapset, env=env
)
# Even g.proj and g.message need GISRC to be present.
# The names don't really matter here.
tmp_gisrc, env = create_environment(
mapset_path.directory, mapset_path.location, mapset_path.mapset, env=env
)

# check if location already exists
if Path(mapset_path.directory, mapset_path.location).exists():
Expand Down

0 comments on commit fc22660

Please sign in to comment.