diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-11-16 09:20:37 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-11-16 09:20:37 +0000 |
commit | 18b297fdc7b5db59db59bdbcf943506370057ab6 (patch) | |
tree | bc3b8287eb7197b31379fb495c66cca4c7d60b0d | |
parent | 00e5df7d31bf9fa0827dc1fe9ee1f7ee61b2b997 (diff) | |
parent | fcd38ea7b29e68ca77595004042d0bb743b85cfa (diff) | |
download | subplot-18b297fdc7b5db59db59bdbcf943506370057ab6.tar.gz |
Merge branch 'fix-subplotlib-prepend-path' into 'main'
subplotlib: Ensure that PATH changes are indeed prepended not appended.
See merge request subplot/subplot!230
-rw-r--r-- | subplotlib/src/steplibrary/runcmd.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/subplotlib/src/steplibrary/runcmd.rs b/subplotlib/src/steplibrary/runcmd.rs index 2bf8c56..f42df6e 100644 --- a/subplotlib/src/steplibrary/runcmd.rs +++ b/subplotlib/src/steplibrary/runcmd.rs @@ -150,8 +150,14 @@ pub fn try_to_run_in(context: &ScenarioContext, dirname: &str, argv0: &str, args let path = context.with( |runcmd: &Runcmd| { Ok(env::join_paths( - env::split_paths(curpath.as_deref().unwrap_or_else(|| OsStr::new(""))) - .chain(runcmd.paths.iter().rev().map(PathBuf::from)), + runcmd + .paths + .iter() + .rev() + .map(PathBuf::from) + .chain(env::split_paths( + curpath.as_deref().unwrap_or_else(|| OsStr::new("")), + )), )?) }, false, |