Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli-test: Path separation compatible with Windows
✗ CI failure Lorenz Leutgeb committed 2 months ago
commit 72659deaddb271b9dea9d5f0f04017a665dbb600
parent 1cab036c331f5ac071f002504c44b01e95b8f25a
2 failed (2 total) View logs
1 file changed +7 -1
modified crates/radicle-cli-test/src/lib.rs
@@ -170,6 +170,11 @@ pub struct TestFormula {

impl TestFormula {
    pub fn new(cwd: PathBuf) -> Self {
+
        #[cfg(windows)]
+
        const PATH_SEPARATOR: char = ';';
+
        #[cfg(not(windows))]
+
        const PATH_SEPARATOR: char = ':';
+

        Self {
            cwd: cwd.clone(),
            env: HashMap::new(),
@@ -178,7 +183,8 @@ impl TestFormula {
            subs: Substitutions::new(),
            bins: env::var("PATH")
                .map(|env_path| {
-
                    let mut bins: Vec<PathBuf> = env_path.split(':').map(PathBuf::from).collect();
+
                    let mut bins: Vec<PathBuf> =
+
                        env_path.split(PATH_SEPARATOR).map(PathBuf::from).collect();
                    // Add current working directory to `$PATH`,
                    // this makes it more convenient to execute scripts during testing.
                    bins.push(cwd);