From fc7d65d95ea9a0f0b72f3ddfc4984e05412f3326 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Wed, 3 Apr 2024 15:12:18 +0200 Subject: [PATCH] fix: Delete git source when specifying registry in Cargo manifest --- dist/build-crates-debian-main.js | 2 ++ dist/build-crates-standalone-main.js | 2 ++ dist/bump-crates-main.js | 2 ++ dist/publish-crates-cargo-main.js | 2 ++ dist/publish-crates-debian-main.js | 2 ++ dist/publish-crates-eclipse-main.js | 2 ++ dist/publish-crates-github-main.js | 2 ++ dist/publish-crates-homebrew-main.js | 2 ++ src/cargo.ts | 2 ++ 9 files changed, 18 insertions(+) diff --git a/dist/build-crates-debian-main.js b/dist/build-crates-debian-main.js index 1f8439a..bbee704 100644 --- a/dist/build-crates-debian-main.js +++ b/dist/build-crates-debian-main.js @@ -128337,6 +128337,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/build-crates-standalone-main.js b/dist/build-crates-standalone-main.js index 571634f..0aed937 100644 --- a/dist/build-crates-standalone-main.js +++ b/dist/build-crates-standalone-main.js @@ -128336,6 +128336,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/bump-crates-main.js b/dist/bump-crates-main.js index 9be774e..fd24218 100644 --- a/dist/bump-crates-main.js +++ b/dist/bump-crates-main.js @@ -82195,6 +82195,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/publish-crates-cargo-main.js b/dist/publish-crates-cargo-main.js index d4f2873..87b1032 100644 --- a/dist/publish-crates-cargo-main.js +++ b/dist/publish-crates-cargo-main.js @@ -82195,6 +82195,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/publish-crates-debian-main.js b/dist/publish-crates-debian-main.js index f2875ec..dca3f70 100644 --- a/dist/publish-crates-debian-main.js +++ b/dist/publish-crates-debian-main.js @@ -128359,6 +128359,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/publish-crates-eclipse-main.js b/dist/publish-crates-eclipse-main.js index a474fef..6c34f06 100644 --- a/dist/publish-crates-eclipse-main.js +++ b/dist/publish-crates-eclipse-main.js @@ -128356,6 +128356,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/publish-crates-github-main.js b/dist/publish-crates-github-main.js index 07e73aa..a6f5612 100644 --- a/dist/publish-crates-github-main.js +++ b/dist/publish-crates-github-main.js @@ -128337,6 +128337,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/dist/publish-crates-homebrew-main.js b/dist/publish-crates-homebrew-main.js index d1cf4fd..04d892d 100644 --- a/dist/publish-crates-homebrew-main.js +++ b/dist/publish-crates-homebrew-main.js @@ -128358,6 +128358,8 @@ async function setRegistry(path, pattern, registry) { if (pattern.test(dep)) { const table = manifest.dependencies[dep]; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } } diff --git a/src/cargo.ts b/src/cargo.ts index 7f042c3..f5a901b 100644 --- a/src/cargo.ts +++ b/src/cargo.ts @@ -226,6 +226,8 @@ export async function setRegistry(path: string, pattern: RegExp, registry: strin if (pattern.test(dep)) { const table = manifest.dependencies[dep] as CargoManifestDependencyTable; table.registry = registry; + // NOTE: Only one of `git` or `registry` is allowed, otherwise the specification is ambiguous + delete table.git; changed = true; } }