mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-16 09:45:01 +00:00
Add color to python pin
CLI (#5215)
## Summary 
This commit is contained in:
parent
12dd450a8e
commit
7762d78281
4 changed files with 61 additions and 43 deletions
|
@ -46,6 +46,12 @@ pub async fn request_from_version_file() -> Result<Option<PythonRequest>, std::i
|
|||
}
|
||||
}
|
||||
|
||||
/// Write a version to a .`python-version` file.
|
||||
pub async fn write_version_file(version: &str) -> Result<(), std::io::Error> {
|
||||
debug!("Writing Python version `{version}` to `{PYTHON_VERSION_FILENAME}`");
|
||||
fs::tokio::write(PYTHON_VERSION_FILENAME, format!("{version}\n")).await
|
||||
}
|
||||
|
||||
async fn read_versions_file() -> Result<Option<Vec<String>>, std::io::Error> {
|
||||
match fs::tokio::read_to_string(PYTHON_VERSIONS_FILENAME).await {
|
||||
Ok(content) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue