summaryrefslogtreecommitdiffstats
path: root/src/modules/utils/test.rs
blob: b3c106b306c64ef565f453a5537351f842c4c265 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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) -> Option<String> {
    let mut context = Context::new_with_dir(clap::ArgMatches::default(), path);
    context.config = StarshipConfig { config: None };
    context.shell = Shell::Unknown;

    crate::print::get_module(module_name, context)
}