diff --git a/swash/processing/swash.py b/swash/processing/swash.py index fc5aa71..0fc4756 100644 --- a/swash/processing/swash.py +++ b/swash/processing/swash.py @@ -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()