mirror of
https://github.com/starship/starship.git
synced 2026-06-24 02:01:36 +07:00
feat: add a container indicator (#3304)
* test: add mock method for absolute files Signed-off-by: Harald Hoyer <harald@hoyer.xyz> * feat(module): add a container indicator module Adds a container type indicator, if inside a container, detected via the presence of some marker files. E.g. inside a podman container entered with `toolbox enter` the prompt changes to the container name and version. ``` starship on container_rebased [$!] is 📦 v1.0.0 via 🦀 v1.56.1 ❯ toolbox enter starship on container_rebased [$!] is 📦 v1.0.0 via 🦀 v1.56.1 ⬢ [fedora-toolbox:35] ❯ ``` Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
@@ -63,6 +63,10 @@ pub struct Context<'a> {
|
||||
#[cfg(test)]
|
||||
pub cmd: HashMap<&'a str, Option<CommandOutput>>,
|
||||
|
||||
/// a mock of the root directory
|
||||
#[cfg(test)]
|
||||
pub root_dir: tempfile::TempDir,
|
||||
|
||||
#[cfg(feature = "battery")]
|
||||
pub battery_info_provider: &'a (dyn crate::modules::BatteryInfoProvider + Send + Sync),
|
||||
|
||||
@@ -155,6 +159,8 @@ impl<'a> Context<'a> {
|
||||
target,
|
||||
width,
|
||||
#[cfg(test)]
|
||||
root_dir: tempfile::TempDir::new().unwrap(),
|
||||
#[cfg(test)]
|
||||
env: HashMap::new(),
|
||||
#[cfg(test)]
|
||||
cmd: HashMap::new(),
|
||||
|
||||
Reference in New Issue
Block a user