diff --git a/dist/build-crates-debian-main.js b/dist/build-crates-debian-main.js index ec063e3..61f216b 100644 --- a/dist/build-crates-debian-main.js +++ b/dist/build-crates-debian-main.js @@ -127543,7 +127543,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/build-crates-standalone-main.js b/dist/build-crates-standalone-main.js index db4a55a..3678b63 100644 --- a/dist/build-crates-standalone-main.js +++ b/dist/build-crates-standalone-main.js @@ -127527,7 +127527,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/bump-crates-main.js b/dist/bump-crates-main.js index 858b629..37da269 100644 --- a/dist/bump-crates-main.js +++ b/dist/bump-crates-main.js @@ -81249,7 +81249,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/publish-crates-cargo-main.js b/dist/publish-crates-cargo-main.js index c709a14..1163df1 100644 --- a/dist/publish-crates-cargo-main.js +++ b/dist/publish-crates-cargo-main.js @@ -81137,7 +81137,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = (0,_command__WEBPACK_IMPORTED_MODULE_5__.sh)(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/publish-crates-debian-main.js b/dist/publish-crates-debian-main.js index db7752e..bd80651 100644 --- a/dist/publish-crates-debian-main.js +++ b/dist/publish-crates-debian-main.js @@ -127522,7 +127522,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/publish-crates-eclipse-main.js b/dist/publish-crates-eclipse-main.js index a8c73fa..e134262 100644 --- a/dist/publish-crates-eclipse-main.js +++ b/dist/publish-crates-eclipse-main.js @@ -127603,7 +127603,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/publish-crates-github-main.js b/dist/publish-crates-github-main.js index 853304d..24b3999 100644 --- a/dist/publish-crates-github-main.js +++ b/dist/publish-crates-github-main.js @@ -127603,7 +127603,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/dist/publish-crates-homebrew-main.js b/dist/publish-crates-homebrew-main.js index 84ae502..ab5e5a1 100644 --- a/dist/publish-crates-homebrew-main.js +++ b/dist/publish-crates-homebrew-main.js @@ -127507,7 +127507,11 @@ function toDebianVersion(version, revision) { */ function isPublished(pkg) { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; } diff --git a/src/cargo.ts b/src/cargo.ts index ed1a669..fc6f01d 100644 --- a/src/cargo.ts +++ b/src/cargo.ts @@ -374,6 +374,10 @@ export function toDebianVersion(version: string, revision?: number): string { */ export function isPublished(pkg: Package): boolean { // Hackish but crates.io doesn't have a stable api anyway. - const publishedVersion = sh(`cargo search ${pkg.name}`).split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); + const results = sh(`cargo search ${pkg.name}`); + if (!results) { + return false; + } + const publishedVersion = results.split("\n").at(0).match(/".*"/g).at(0).slice(1, -1); return publishedVersion === pkg.version; }