feat: Add more variables for template (#1160)

Fixed #775

 - Add dep target-lexicon v0.12.7
 - Add `target-{family, arch, libc, vendor}` to
   `package.metadata.binstall`.

For `{universal, universal2}-apple-darwin`, the `target-arch` is set to
`universal`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-06-21 08:05:13 +10:00 committed by GitHub
parent 181b5293e7
commit d8419ea5a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 210 additions and 115 deletions

View file

@ -9,6 +9,7 @@ use crate::{
helpers::{
download::{Download, ExtractedFiles},
gh_api_client::GhApiClient,
is_universal_macos,
remote::{does_url_exist, Client, Method},
tasks::AutoAbortJoinHandle,
},
@ -20,10 +21,6 @@ use super::{Data, TargetData};
const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download";
const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate";
fn is_universal_macos(target: &str) -> bool {
["universal-apple-darwin", "universal2-apple-darwin"].contains(&target)
}
pub struct QuickInstall {
client: Client,
gh_api_client: GhApiClient,
@ -136,6 +133,10 @@ by rust officially."#,
fn target(&self) -> &str {
&self.target_data.target
}
fn target_data(&self) -> &Arc<TargetData> {
&self.target_data
}
}
impl QuickInstall {