Run `atomic` in `dir` with an isolated config dir (`home/.atomic`) and a clean logging environment, plus `envs`. `ATOMIC_CONFIG_DIR` rather than `HOME` alone: on Windows the home directory ignores `HOME`.
(dir: &Path, home: &Path, envs: &[(&str, &OsStr)], args: &[&str])
| 16 | /// clean logging environment, plus `envs`. `ATOMIC_CONFIG_DIR` rather than |
| 17 | /// `HOME` alone: on Windows the home directory ignores `HOME`. |
| 18 | fn atomic(dir: &Path, home: &Path, envs: &[(&str, &OsStr)], args: &[&str]) -> Output { |
| 19 | let mut command = Command::new(ATOMIC_BIN); |
| 20 | command |
| 21 | .args(args) |
| 22 | .current_dir(dir) |
| 23 | .env("HOME", home) |
| 24 | .env("ATOMIC_CONFIG_DIR", home.join(".atomic")) |
| 25 | .env_remove("ATOMIC_LOG") |
| 26 | .env_remove("ATOMIC_LOG_DIR") |
| 27 | .env_remove("RUST_LOG"); |
| 28 | for (key, value) in envs { |
| 29 | command.env(key, value); |
| 30 | } |
| 31 | command.output().expect("run atomic") |
| 32 | } |
| 33 | |
| 34 | fn git(dir: &Path, args: &[&str]) -> String { |
| 35 | let output = Command::new("git") |
no test coverage detected