fix: correctly get index URLs in publish command

This commit is contained in:
dai 2024-12-12 13:36:22 +00:00 committed by daimond113
parent 381740d2ce
commit f8d0bc6c4d
No known key found for this signature in database
GPG key ID: 3A8ECE51328B513C
2 changed files with 8 additions and 12 deletions

View file

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Correctly resolve URLs in `publish` command by @daimond113
## [0.5.0-rc.17] - 2024-12-11
### Added
- Allow multiple, user selectable scripts packages to be selected (& custom packages inputted) in `init` command by @daimond113

View file

@ -585,22 +585,14 @@ info: otherwise, the file was deemed unnecessary, if you don't understand why, p
DependencySpecifiers::Pesde(spec) => {
!config.other_registries_allowed.is_allowed_or_same(
source.repo_url().clone(),
manifest
.indices
.get(spec.index.as_deref().unwrap_or(DEFAULT_INDEX_NAME))
.unwrap()
.clone(),
gix::Url::try_from(spec.index.as_deref().unwrap()).unwrap(),
)
}
DependencySpecifiers::Git(spec) => !config.git_allowed.is_allowed(spec.repo.clone()),
#[cfg(feature = "wally-compat")]
DependencySpecifiers::Wally(spec) => !config.wally_allowed.is_allowed(
manifest
.wally_indices
.get(spec.index.as_deref().unwrap_or(DEFAULT_INDEX_NAME))
.unwrap()
.clone(),
),
DependencySpecifiers::Wally(spec) => !config
.wally_allowed
.is_allowed(gix::Url::try_from(spec.index.as_deref().unwrap()).unwrap()),
_ => false,
}) {
anyhow::bail!("dependency `{disallowed}` is not allowed on this index");