mirror of
https://github.com/starship/starship.git
synced 2026-06-24 02:01:36 +07:00
fix: Lazy load git repo and only run module if not disabled (#306)
A couple of optimizations are done in this PR. One, we now will check config ahead of time to see if a module is disabled before running any module code. Also, we won't try to discover a git repository unless the module requests access to it.
This commit is contained in:
committed by
Matan Kushner
parent
dc8409333e
commit
9f70ffb7a7
@@ -22,7 +22,7 @@ use super::{Context, Module};
|
||||
/// - pure // use_name == false in a pure nix-shell
|
||||
/// - impure // use_name == false in an impure nix-shell
|
||||
pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
let mut module = context.new_module("nix_shell")?;
|
||||
let mut module = context.new_module("nix_shell");
|
||||
|
||||
env::var("IN_NIX_SHELL")
|
||||
.ok()
|
||||
|
||||
Reference in New Issue
Block a user