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]
|
||||
### Added
|
||||
- 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
|
||||
### Changed
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
use std::{fs::create_dir_all, io::Read, path::PathBuf};
|
||||
|
||||
use anyhow::Context;
|
||||
use colored::Colorize;
|
||||
use reqwest::header::ACCEPT;
|
||||
use semver::Version;
|
||||
use serde::Deserialize;
|
||||
use std::{fs::create_dir_all, io::Read, path::PathBuf};
|
||||
|
||||
use crate::cli::{
|
||||
bin_dir,
|
||||
|
@ -160,9 +159,7 @@ pub fn get_or_download_version(
|
|||
let path = home_dir()?.join("versions");
|
||||
create_dir_all(&path).context("failed to create versions directory")?;
|
||||
|
||||
let path = path
|
||||
.join(version.to_string())
|
||||
.with_extension(std::env::consts::EXE_EXTENSION);
|
||||
let path = path.join(format!("{version}{}", std::env::consts::EXE_SUFFIX));
|
||||
|
||||
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<()> {
|
||||
let copy_to = bin_dir()?
|
||||
.join(env!("CARGO_BIN_NAME"))
|
||||
.with_extension(std::env::consts::EXE_EXTENSION);
|
||||
let copy_to = bin_dir()?.join(format!(
|
||||
"{}{}",
|
||||
env!("CARGO_BIN_NAME"),
|
||||
std::env::consts::EXE_SUFFIX
|
||||
));
|
||||
|
||||
std::fs::copy(std::env::current_exe()?, ©_to)
|
||||
.context("failed to copy executable to bin folder")?;
|
||||
|
|
Loading…
Reference in a new issue