Updated path to add to user path
This commit is contained in:
parent
ca099834ca
commit
b0c316ff37
1 changed files with 9 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
|||
import logging
|
||||
import os
|
||||
import sys
|
||||
import argparse
|
||||
import pathlib
|
||||
|
@ -30,7 +31,9 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw:
|
|||
|
||||
log.info(f"Copying files to '{tmpdir}'")
|
||||
shutil.copy2(inp, tmpdir)
|
||||
shutil.copytree(pathlib.Path(config.get("data", "out")), tmpdir, dirs_exist_ok=True)
|
||||
shutil.copytree(
|
||||
pathlib.Path(config.get("data", "out")), tmpdir, dirs_exist_ok=True
|
||||
)
|
||||
|
||||
if config.has_option("swash", "mpi"):
|
||||
mpi = ("-mpi", config.get("swash", "mpi"))
|
||||
|
@ -46,7 +49,11 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw:
|
|||
log.info(f"Running {cmd}")
|
||||
|
||||
swash_run = subprocess.Popen(
|
||||
cmd, cwd=tmpdir, stdout=logfile, stderr=logfile, env={"PATH": path}
|
||||
cmd,
|
||||
cwd=tmpdir,
|
||||
stdout=logfile,
|
||||
stderr=logfile,
|
||||
env={"PATH": f"{path}:{os.environ['PATH']}"},
|
||||
)
|
||||
|
||||
code = swash_run.wait()
|
||||
|
|
Loading…
Reference in a new issue