From e16ca0b856e7299fd933b494a88ef1a7390fa5e8 Mon Sep 17 00:00:00 2001 From: gbuomprisco Date: Sun, 22 Sep 2024 18:24:25 +0200 Subject: [PATCH] Do not throw if a remote repository is not found --- tooling/license/src/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tooling/license/src/index.js b/tooling/license/src/index.js index dd225f62f..07786f5ff 100644 --- a/tooling/license/src/index.js +++ b/tooling/license/src/index.js @@ -39,8 +39,7 @@ function checkVisibility() { .toString() .trim(); } catch (error) { - console.error('Error getting git remote URL:', error.message); - process.exit(1); + return; } if (!remoteUrl.includes('github.com')) { @@ -48,13 +47,13 @@ function checkVisibility() { } let ownerRepo; + if (remoteUrl.startsWith('https://github.com/')) { ownerRepo = remoteUrl.slice('https://github.com/'.length); } else if (remoteUrl.startsWith('git@github.com:')) { ownerRepo = remoteUrl.slice('git@github.com:'.length); } else { - console.error('Unsupported GitHub URL format'); - process.exit(1); + return; } ownerRepo = ownerRepo.replace(/\.git$/, '');