diff options
author | Akshay <[email protected]> | 2021-04-02 13:45:56 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-04-02 13:49:14 +0100 |
commit | 5b022fa71a26176dabc92afb211ab8f3707c2020 (patch) | |
tree | 7c99231f67dfbe0acba4b16afd834d6d46f82dde /src/main.rs | |
parent | 283fa45c517d6ed6e57db738769c92cac66dcb92 (diff) |
add flag to disable vcsv0.1.5
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index 1a77759..6ccca7b 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -3,6 +3,8 @@ mod prompt_char; | |||
3 | mod vcs; | 3 | mod vcs; |
4 | mod venv; | 4 | mod venv; |
5 | 5 | ||
6 | use std::env; | ||
7 | |||
6 | use clap::{App, Arg}; | 8 | use clap::{App, Arg}; |
7 | use colored::*; | 9 | use colored::*; |
8 | 10 | ||
@@ -36,7 +38,10 @@ fn pista(zsh: bool) -> String { | |||
36 | Some(c) => c, | 38 | Some(c) => c, |
37 | None => "[directory does not exist]".color("red"), | 39 | None => "[directory does not exist]".color("red"), |
38 | }; | 40 | }; |
39 | let (branch, status) = vcs::vcs_status().unwrap_or(("".into(), "".into())); | 41 | let (branch, status) = match env::var("DISABLE_VCS").unwrap_or("0".into()).as_ref() { |
42 | "0" => vcs::vcs_status().unwrap_or(("".into(), "".into())), | ||
43 | _ => ("".into(), "".into()) | ||
44 | }; | ||
40 | let venv = venv::get_name(); | 45 | let venv = venv::get_name(); |
41 | let prompt_char = prompt_char::get_char(); | 46 | let prompt_char = prompt_char::get_char(); |
42 | if zsh { | 47 | if zsh { |