lib/
default_shells.rs

1// This file defines the default shells, which will be used if the user doesn't specify a default shell
2
3use crate::schema;
4use std::collections::HashMap;
5
6// Gets the default shells
7pub fn get_default_shells() -> schema::DefaultShell {
8    let mut targets = HashMap::new();
9    targets.insert(
10        "windows".to_string(),
11        schema::Shell {
12            parts: vec![
13                "powershell".to_string(),
14                "-command".to_string(),
15                "{COMMAND}".to_string(),
16            ],
17            delimiter: " ; ".to_string(),
18        },
19    );
20    targets.insert(
21        "macos".to_string(),
22        schema::Shell {
23            parts: vec!["sh".to_string(), "-c".to_string(), "{COMMAND}".to_string()],
24            delimiter: " && ".to_string(),
25        },
26    );
27    targets.insert(
28        "linux".to_string(),
29        schema::Shell {
30            parts: vec!["sh".to_string(), "-c".to_string(), "{COMMAND}".to_string()],
31            delimiter: " && ".to_string(),
32        },
33    );
34
35    schema::DefaultShell {
36        // If we have no idea where we're running, Linux Master Race
37        generic: schema::Shell {
38            parts: vec!["sh".to_string(), "-c".to_string(), "{COMMAND}".to_string()],
39            delimiter: " && ".to_string(),
40        },
41        targets,
42    }
43}