diff --git a/docs/registry.md b/docs/registry.md index 851cc06cbd..d76629f306 100644 --- a/docs/registry.md +++ b/docs/registry.md @@ -171,6 +171,7 @@ You can also specify the full name for a tool using `mise use aqua:1password/cli | cyclonedx | [aqua:CycloneDX/cyclonedx-cli](https://github.com/CycloneDX/cyclonedx-cli) [asdf:xeedio/asdf-cyclonedx](https://github.com/xeedio/asdf-cyclonedx) | | dagger | [aqua:dagger/dagger](https://github.com/dagger/dagger) [asdf:virtualstaticvoid/asdf-dagger](https://github.com/virtualstaticvoid/asdf-dagger) | | danger-js | [asdf:MontakOleg/asdf-danger-js](https://github.com/MontakOleg/asdf-danger-js) | +| danger-swift | [spm:danger/swift](https://github.com/danger/swift) | | dapr | [aqua:dapr/cli](https://github.com/dapr/cli) [asdf:asdf-community/asdf-dapr-cli](https://github.com/asdf-community/asdf-dapr-cli) | | dart | [asdf:PatOConnor43/asdf-dart](https://github.com/PatOConnor43/asdf-dart) [vfox:version-fox/vfox-dart](https://github.com/version-fox/vfox-dart) | | dasel | [aqua:TomWright/dasel](https://github.com/TomWright/dasel) [asdf:asdf-community/asdf-dasel](https://github.com/asdf-community/asdf-dasel) | diff --git a/registry.toml b/registry.toml index 26a3511364..05f9f57ea6 100644 --- a/registry.toml +++ b/registry.toml @@ -248,6 +248,7 @@ cyclonedx.backends = ["aqua:CycloneDX/cyclonedx-cli", "asdf:xeedio/asdf-cycloned cyclonedx.test = ["cyclonedx --version", "{{version}}"] dagger.backends = ["aqua:dagger/dagger", "asdf:virtualstaticvoid/asdf-dagger"] danger-js.backends = ["asdf:MontakOleg/asdf-danger-js"] +danger-swift.backends = ["spm:danger/swift"] dapr.backends = ["aqua:dapr/cli", "asdf:asdf-community/asdf-dapr-cli"] dapr.test = ["dapr --version", "CLI version: {{version}}"] dart.backends = ["asdf:PatOConnor43/asdf-dart", "vfox:version-fox/vfox-dart"] diff --git a/scripts/render-registry.js b/scripts/render-registry.js index 7938dc845f..6bf1a960e4 100755 --- a/scripts/render-registry.js +++ b/scripts/render-registry.js @@ -58,6 +58,8 @@ for (const match of stdout.split("\n")) { return `[${match[1]}:${match[2]}](https://pypi.org/project/${match[2]})`; } else if (match[1] === "go") { return `[${match[1]}:${match[2]}](https://pkg.go.dev/${match[2]})`; + } else if (match[1] === "spm") { + return `[${match[1]}:${match[2]}](https://github.com/${match[2]})`; } else if (match[1] === "ubi") { return `[${match[1]}:${match[2]}](https://github.com/${match[2]})`; } else if (match[1] === "aqua") { diff --git a/src/backend/spm.rs b/src/backend/spm.rs index 10d3b1e9cb..e3ee455217 100644 --- a/src/backend/spm.rs +++ b/src/backend/spm.rs @@ -203,6 +203,7 @@ struct SwiftPackageRepo { impl SwiftPackageRepo { /// Parse the slug or the full URL of a GitHub package repository. fn new(name: &str) -> Result { + let name = name.strip_prefix("spm:").unwrap_or(name); let shorthand_regex = regex!(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+$"); let shorthand_in_url_regex = regex!(r"https://github.com/([a-zA-Z0-9_-]+/[a-zA-Z0-9._-]+)\.git");