diff --git a/swash/processing/swash.py b/swash/processing/swash.py index 7e698d3..1a739a8 100644 --- a/swash/processing/swash.py +++ b/swash/processing/swash.py @@ -46,13 +46,17 @@ with tempfile.TemporaryDirectory(prefix="swash_", dir=".") as tmp_raw: cmd = (config.get("swash", "swashrun"), "-input", inp.name, *mpi) log.info(f"Running {cmd}") - subprocess.run( + subprocess.Popen( cmd, cwd=tmpdir, stdout=logfile, stderr=logfile, ) + code = subprocess.wait() + if code is not 0: + log.error(f"Swash returned error code {code}") + log.info(f"Moving swash output to '{out}'") shutil.move(tmpdir, out)