mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Support subcrate in repo (#991)
Fixed #838 - Add new key `subcrate` for rendering `pkg-url` - Add new release paths in GitHub, GitLab & SourceForge using key `subcrate` for auto-detection - Add subcrate detection for GitHub and GitLab - Add `debug!` when using gh api token in `GhApiClient::new` - Add subcrate testing to `e2e-tests/subcrate.sh` - Bump cargo-release to 0.24.9 in e2e-tests/live.sh to fix test failure on MacOS without libssl installed in `/usr/local/`. - Optimize GhCrateMeta: Detect subcrate and repo-host in `Data::get_repo_info` to cache the result and avoid duplicate works, this also makes the code more ergonomic by removing the need to some `unwrap()` plus making it more efficient since we don't need to clone the url just to modify it. - Add instrument to `Data::get_repo_info` - Fix `shellcheck` err in `e2e-tests/*.sh` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
5e269193c0
commit
0261d12d9d
15 changed files with 234 additions and 40 deletions
|
@ -7,7 +7,7 @@ use std::{
|
|||
|
||||
use compact_str::{CompactString, ToCompactString};
|
||||
use tokio::sync::OnceCell;
|
||||
use tracing::warn;
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::remote;
|
||||
|
||||
|
@ -106,6 +106,7 @@ impl GhApiClient {
|
|||
pub fn new(client: remote::Client, auth_token: Option<CompactString>) -> Self {
|
||||
let auth_token = auth_token.and_then(|auth_token| {
|
||||
if gh_prefixed(&auth_token) {
|
||||
debug!("Using gh api token");
|
||||
Some(auth_token)
|
||||
} else {
|
||||
warn!("Invalid auth_token, expected 'gh*_' or `github_*`, fallback to unauthorized mode");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue