mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
fix: handle versions with dots
This commit is contained in:
parent
962482962b
commit
36d9ca0634
2 changed files with 9 additions and 8 deletions
|
@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
- Add support for multiple targets under the same package name in workspace members by @daimond113
|
- Add support for multiple targets under the same package name in workspace members by @daimond113
|
||||||
|
### Fixed
|
||||||
|
- Fix versions with dots not being handled correctly by @daimond113
|
||||||
|
|
||||||
## [0.5.0-rc.1] - 2024-10-06
|
## [0.5.0-rc.1] - 2024-10-06
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
use std::{fs::create_dir_all, io::Read, path::PathBuf};
|
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use reqwest::header::ACCEPT;
|
use reqwest::header::ACCEPT;
|
||||||
use semver::Version;
|
use semver::Version;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
use std::{fs::create_dir_all, io::Read, path::PathBuf};
|
||||||
|
|
||||||
use crate::cli::{
|
use crate::cli::{
|
||||||
bin_dir,
|
bin_dir,
|
||||||
|
@ -160,9 +159,7 @@ pub fn get_or_download_version(
|
||||||
let path = home_dir()?.join("versions");
|
let path = home_dir()?.join("versions");
|
||||||
create_dir_all(&path).context("failed to create versions directory")?;
|
create_dir_all(&path).context("failed to create versions directory")?;
|
||||||
|
|
||||||
let path = path
|
let path = path.join(format!("{version}{}", std::env::consts::EXE_SUFFIX));
|
||||||
.join(version.to_string())
|
|
||||||
.with_extension(std::env::consts::EXE_EXTENSION);
|
|
||||||
|
|
||||||
let is_requested_version = *version == current_version();
|
let is_requested_version = *version == current_version();
|
||||||
|
|
||||||
|
@ -225,9 +222,11 @@ pub fn max_installed_version() -> anyhow::Result<Version> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_bin_exe() -> anyhow::Result<()> {
|
pub fn update_bin_exe() -> anyhow::Result<()> {
|
||||||
let copy_to = bin_dir()?
|
let copy_to = bin_dir()?.join(format!(
|
||||||
.join(env!("CARGO_BIN_NAME"))
|
"{}{}",
|
||||||
.with_extension(std::env::consts::EXE_EXTENSION);
|
env!("CARGO_BIN_NAME"),
|
||||||
|
std::env::consts::EXE_SUFFIX
|
||||||
|
));
|
||||||
|
|
||||||
std::fs::copy(std::env::current_exe()?, ©_to)
|
std::fs::copy(std::env::current_exe()?, ©_to)
|
||||||
.context("failed to copy executable to bin folder")?;
|
.context("failed to copy executable to bin folder")?;
|
||||||
|
|
Loading…
Reference in a new issue