mirror of
https://github.com/Llewellynvdm/starship.git
synced 2025-02-04 21:18:32 +00:00
feat(cmd_duration): make notify feature optional (compat with nix darwin) (#3855)
This commit is contained in:
parent
59fc274fb7
commit
efaab49e47
@ -30,9 +30,10 @@ The minimal, blazing-fast, and infinitely customizable prompt for any shell! ☄
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["battery"]
|
default = ["battery", "notify"]
|
||||||
battery = ["starship-battery"]
|
battery = ["starship-battery"]
|
||||||
config-schema = ["schemars"]
|
config-schema = ["schemars"]
|
||||||
|
notify = ["notify-rust"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
ansi_term = "0.12.1"
|
ansi_term = "0.12.1"
|
||||||
@ -47,7 +48,9 @@ git2 = { version = "0.14.2", default-features = false }
|
|||||||
indexmap = { version = "1.8.1", features = ["serde"] }
|
indexmap = { version = "1.8.1", features = ["serde"] }
|
||||||
local_ipaddress = "0.1.3"
|
local_ipaddress = "0.1.3"
|
||||||
log = { version = "0.4.16", features = ["std"] }
|
log = { version = "0.4.16", features = ["std"] }
|
||||||
notify-rust = "4.5.8"
|
# nofity-rust is optional (on by default) because the crate doesn't currently build for darwin with nix
|
||||||
|
# see: https://github.com/NixOS/nixpkgs/issues/160876
|
||||||
|
notify-rust = { version = "4.5.8", optional = true }
|
||||||
once_cell = "1.10.0"
|
once_cell = "1.10.0"
|
||||||
open = "2.1.1"
|
open = "2.1.1"
|
||||||
os_info = "3.2.0"
|
os_info = "3.2.0"
|
||||||
|
@ -51,6 +51,16 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
|||||||
Some(undistract_me(module, &config, elapsed))
|
Some(undistract_me(module, &config, elapsed))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "notify"))]
|
||||||
|
fn undistract_me<'a, 'b>(
|
||||||
|
module: Module<'a>,
|
||||||
|
_config: &'b CmdDurationConfig,
|
||||||
|
_elapsed: u128,
|
||||||
|
) -> Module<'a> {
|
||||||
|
module
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "notify")]
|
||||||
fn undistract_me<'a, 'b>(
|
fn undistract_me<'a, 'b>(
|
||||||
module: Module<'a>,
|
module: Module<'a>,
|
||||||
config: &'b CmdDurationConfig,
|
config: &'b CmdDurationConfig,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user