44 lines
1.4 KiB
Rust
44 lines
1.4 KiB
Rust
//! `leleka.exe` on Windows: the commands of the WSL2 route (`up`, `preflight`, `verify`, `status`, `reconfigure`, `down`,
|
|
//! `doctor`). `dispatch` returns `None` for everything that the ordinary (native) command code handles.
|
|
//!
|
|
//! The Linux `leleka` inside the distribution does the deployment work, exactly as it does on a Linux host; this file only
|
|
//! starts it through `wsl.exe`, translates paths, and reads state and talks to the engine from the Windows side.
|
|
use crate::{
|
|
app::{print_status, send_reconfigure},
|
|
cli::split_reconfigure,
|
|
facts::{ProbeRequest, probe},
|
|
steps::{fetch_status_with_key, probe_ready_with_key},
|
|
wsl::{
|
|
Bridge, BridgeState, Forwarded, effective_wsl_memory, is_drvfs, linux_to_unc, list_distros,
|
|
parse_wslconfig, pick_distro, translate_args, wsl_exe, wslconfig_advice,
|
|
},
|
|
};
|
|
use serde_json::Value;
|
|
use std::{path::PathBuf, time::Duration};
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
pub enum Route {
|
|
Wsl,
|
|
Native,
|
|
}
|
|
|
|
struct Session {
|
|
bridge: Bridge,
|
|
home: String,
|
|
forwarded: Forwarded,
|
|
saved: Option<BridgeState>,
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod tests;
|
|
|
|
mod commands;
|
|
mod doctor_command;
|
|
mod routing;
|
|
mod session;
|
|
use commands::{down, find_repo, reconfigure, status};
|
|
use doctor_command::doctor;
|
|
pub use routing::{dispatch, split_route};
|
|
use routing::{local_app_data, note, open_session};
|
|
use session::{forward, wsl_route};
|