mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
make the battery module optional for now (#234)
The 'battery' crate doesn't support Termux, so we are temporarily making the battery module optional.
This commit is contained in:
committed by
Matan Kushner
parent
f7754455e6
commit
0fa862a2e9
@@ -6,6 +6,7 @@ use std::fmt;
|
||||
|
||||
// List of all modules
|
||||
pub const ALL_MODULES: &[&str] = &[
|
||||
#[cfg(feature = "battery")]
|
||||
"battery",
|
||||
"character",
|
||||
"cmd_duration",
|
||||
|
||||
+4
-1
@@ -1,5 +1,4 @@
|
||||
// While adding out new module add out module to src/module.rs ALL_MODULES const array also.
|
||||
mod battery;
|
||||
mod character;
|
||||
mod cmd_duration;
|
||||
mod directory;
|
||||
@@ -16,6 +15,9 @@ mod ruby;
|
||||
mod rust;
|
||||
mod username;
|
||||
|
||||
#[cfg(feature = "battery")]
|
||||
mod battery;
|
||||
|
||||
use crate::context::Context;
|
||||
use crate::module::Module;
|
||||
|
||||
@@ -33,6 +35,7 @@ pub fn handle<'a>(module: &str, context: &'a Context) -> Option<Module<'a>> {
|
||||
"git_branch" => git_branch::module(context),
|
||||
"git_status" => git_status::module(context),
|
||||
"username" => username::module(context),
|
||||
#[cfg(feature = "battery")]
|
||||
"battery" => battery::module(context),
|
||||
"cmd_duration" => cmd_duration::module(context),
|
||||
"jobs" => jobs::module(context),
|
||||
|
||||
@@ -26,6 +26,7 @@ const DEFAULT_PROMPT_ORDER: &[&str] = &[
|
||||
"cmd_duration",
|
||||
"line_break",
|
||||
"jobs",
|
||||
#[cfg(feature = "battery")]
|
||||
"battery",
|
||||
"character",
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user