1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-05-29 06:30:52 +00:00
starship/src/modules/utils/test.rs
Karol Fuksiewicz eba4d87612
feat(package): configurable displaying package version for packages marked as private (#1109)
* feat(package): config for enabling package version in private packages

* test(package): refactor package tests
2020-04-28 10:53:30 +02:00

17 lines
476 B
Rust

use crate::config::StarshipConfig;
use crate::context::{Context, Shell};
use std::path::Path;
/// Render a specific starship module by name
pub fn render_module(
module_name: &str,
path: &Path,
config: Option<toml::Value>,
) -> Option<String> {
let mut context = Context::new_with_dir(clap::ArgMatches::default(), path);
context.config = StarshipConfig { config };
context.shell = Shell::Unknown;
crate::print::get_module(module_name, context)
}