1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pub mod custom;
mod engine;
mod local;
pub mod remote;
mod shared;

pub use self::engine::*;
pub use self::shared::*;

use std::process::ExitStatus;

use crate::errors::*;
use crate::shell::MessageInfo;

pub fn run(
    options: DockerOptions,
    paths: DockerPaths,
    args: &[String],
    msg_info: &mut MessageInfo,
) -> Result<ExitStatus> {
    if cfg!(target_os = "windows") && options.in_docker() {
        msg_info.fatal(
            "running cross insider a container running windows is currently unsupported",
            1,
        );
    }
    if options.is_remote() {
        remote::run(options, paths, args, msg_info).wrap_err("could not complete remote run")
    } else {
        local::run(options, paths, args, msg_info)
    }
}