use std::path::{Path, PathBuf};
use anyhow::Result;
use super::Plan;
pub const AVAILABLE: bool = false;
pub struct Session {
pub warnings: Vec<String>,
}
impl Session {
pub fn files(&self) -> usize {
0
}
pub fn directories(&self) -> usize {
0
}
pub fn refused_directories(&self) -> usize {
0
}
pub fn park(self) -> Result<()> {
unreachable!("no session can be started on {}", std::env::consts::OS)
}
}
pub fn start(_root: &Path, _plan: &Plan) -> Result<Session> {
anyhow::bail!(
"a guard cannot protect a process it did not start on {}. `ralon run -- <agent>` \
restricts the agent and every process it spawns, which is stronger — it is \
inherited rather than held, so there is nothing to kill.",
std::env::consts::OS
)
}
pub fn stop(_root: &Path) -> Result<bool> {
Ok(false)
}
pub fn running(_root: &Path) -> bool {
false
}
pub fn detach(root: &Path) -> Result<()> {
start(root, &Plan::build(super::Backend::Auto, root, Vec::new())).map(|_| ())
}
pub fn silence_standard_handles() {}
pub fn leftovers(_protected: &[PathBuf]) -> Vec<PathBuf> {
Vec::new()
}
pub fn clear_leftovers(_protected: &[PathBuf]) -> Vec<PathBuf> {
Vec::new()
}