mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
Add support for detecting Python from Pipenv files (#221)
Added the ability to enable the Python module based on the existence of the a `Pipfile`.
This commit is contained in:
committed by
Kevin Song
parent
360ea988e5
commit
1478f8c2e9
@@ -15,10 +15,16 @@ use super::{Context, Module};
|
||||
/// - Current directory contains a `requirements.txt` file
|
||||
/// - Current directory contains a `pyproject.toml` file
|
||||
/// - Current directory contains a file with the `.py` extension
|
||||
/// - Current directory contains a `Pipfile` file
|
||||
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"])
|
||||
.set_files(&[
|
||||
"requirements.txt",
|
||||
".python-version",
|
||||
"pyproject.toml",
|
||||
"Pipfile",
|
||||
])
|
||||
.set_extensions(&["py"])
|
||||
.scan();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user