mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
feat(registry): use env variable for repo
This commit is contained in:
parent
d321b8b0aa
commit
c08dfb9965
3 changed files with 6 additions and 4 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
INDEX_REPO_URL = # url of the index repository
|
||||||
|
|
||||||
GITHUB_USERNAME= # username of github account with push access to the index repository
|
GITHUB_USERNAME= # username of github account with push access to the index repository
|
||||||
GITHUB_PAT= # personal access token of github account with push access to the index repository
|
GITHUB_PAT= # personal access token of github account with push access to the index repository
|
||||||
|
|
||||||
|
|
|
@ -288,10 +288,10 @@ pub async fn publish_package(
|
||||||
DependencySpecifiers::Pesde(specifier) => {
|
DependencySpecifiers::Pesde(specifier) => {
|
||||||
if specifier
|
if specifier
|
||||||
.index
|
.index
|
||||||
.as_ref()
|
.as_deref()
|
||||||
.filter(|index| match index.parse::<url::Url>() {
|
.filter(|index| match gix::Url::try_from(*index) {
|
||||||
Ok(_) if config.other_registries_allowed => true,
|
Ok(_) if config.other_registries_allowed => true,
|
||||||
Ok(url) => url == env!("CARGO_PKG_REPOSITORY").parse().unwrap(),
|
Ok(url) => url == *source.repo_url(),
|
||||||
Err(_) => false,
|
Err(_) => false,
|
||||||
})
|
})
|
||||||
.is_none()
|
.is_none()
|
||||||
|
|
|
@ -85,7 +85,7 @@ async fn run(with_sentry: bool) -> std::io::Result<()> {
|
||||||
password: benv!(required "GITHUB_PAT"),
|
password: benv!(required "GITHUB_PAT"),
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
let source = PesdePackageSource::new(env!("CARGO_PKG_REPOSITORY").try_into().unwrap());
|
let source = PesdePackageSource::new(benv!(required "INDEX_REPO_URL").try_into().unwrap());
|
||||||
source.refresh(&project).expect("failed to refresh source");
|
source.refresh(&project).expect("failed to refresh source");
|
||||||
|
|
||||||
let (search_reader, search_writer) = make_search(&project, &source);
|
let (search_reader, search_writer) = make_search(&project, &source);
|
||||||
|
|
Loading…
Reference in a new issue