summaryrefslogtreecommitdiffstats
path: root/src/modules/python.rs
diff options
context:
space:
mode:
authorMatan Kushner <hello@matchai.me>2019-07-02 16:12:53 -0400
committerGitHub <noreply@github.com>2019-07-02 16:12:53 -0400
commit463ec260247fa0e62d2ea14e237681a499955392 (patch)
tree0d7ed8d19187c298c2e7764f21387a919d21877c /src/modules/python.rs
parent2440ed60d0a315e6248c040d2a114f7deeea6260 (diff)
feat: Add a `disabled` configuration option for modules (#86)
• Add support for the disabled configuration option This will allow you to selectively disable modules that you don't want or need. 😄 • Overwrite starship configuration file path with STARSHIP_CONFIG environment variable • Write tests for the two configuration options that are available
Diffstat (limited to 'src/modules/python.rs')
-rw-r--r--src/modules/python.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/python.rs b/src/modules/python.rs
index 8b72e5187..a1a36cd3a 100644
--- a/src/modules/python.rs
+++ b/src/modules/python.rs
@@ -10,7 +10,7 @@ use super::{Context, Module};
/// - Current directory contains a `.python-version` file
/// - Current directory contains a `requirements.txt` file
/// - Current directory contains a `pyproject.toml` file
-pub fn segment<'a>(context: &'a Context) -> Option<Module<'a>> {
+pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
let is_py_project = context
.new_scan_dir()
.set_files(&["requirements.txt", ".python-version", "pyproject.toml"])
@@ -26,7 +26,7 @@ pub fn segment<'a>(context: &'a Context) -> Option<Module<'a>> {
const PYTHON_CHAR: &str = "🐍 ";
let module_color = Color::Yellow.bold();
- let mut module = context.new_module("python");
+ let mut module = context.new_module("python")?;
module.set_style(module_color);
let formatted_version = format_python_version(python_version);