Skip to content

Commit

Permalink
♻️ refactor version matching logic to fix old version installation
Browse files Browse the repository at this point in the history
  • Loading branch information
salamaashoush committed Sep 10, 2024
1 parent 000967d commit e68b652
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 225 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test-log = "0.2"
flate2 = "1.0"
walkdir = "2.5"
indicatif = { version = "0.17", features = ["improved_unicode"] }
regex = "1.5"

[dev-dependencies]
pretty_assertions = "1.4"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ cargo test

- Windows is not supported because Pact does not support Windows anyway.
- The Pact binaries are problematic; they are not consistent in each release, and often, releases are missing binaries. For example, the latest release, 4.12, does not have any Mac binaries on GitHub. Expect some issues with this.
- Some older versions might require older system libs (eg. libncurses5).

## Credit

Expand Down
76 changes: 0 additions & 76 deletions src/arch.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/commands/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl Command for Install {
);
match install_pact_dist(
version,
&release.download_url(&config.arch),
&release.download_url(),
config.installations_dir(),
&config.arch,
show_progress,
Expand Down
4 changes: 4 additions & 0 deletions src/commands/ls_remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ impl super::command::Command for LsRemote {
print!("{}", " (nightly)".to_string().cyan());
}

if !version.has_supported_asset() {
print!("{}", " (can't install)".to_string().red());
}

println!();
}

Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::log_level::LogLevel;
use crate::path_ext::PathExt;
use crate::version_file_strategy::VersionFileStrategy;
use crate::{arch::Arch, directories::Directories};
use crate::{directories::Directories, system_info::Arch};

#[derive(clap::Parser, Debug)]
pub struct PactupConfig {
Expand Down
2 changes: 1 addition & 1 deletion src/downloader.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::arch::Arch;
use crate::archive;
use crate::archive::extract::ArchiveType;
use crate::archive::{Error as ExtractError, Extract};
use crate::directory_portal::DirectoryPortal;
use crate::progress::ResponseProgress;
use crate::system_info::Arch;
use crate::version::Version;
use indicatif::ProgressDrawTarget;
use log::debug;
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
)]

mod alias;
mod arch;
mod archive;
mod choose_version_for_user_input;
mod cli;
Expand Down
Loading

0 comments on commit e68b652

Please sign in to comment.