Do not throw if a remote repository is not found
This commit is contained in:
@@ -39,8 +39,7 @@ function checkVisibility() {
|
|||||||
.toString()
|
.toString()
|
||||||
.trim();
|
.trim();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error getting git remote URL:', error.message);
|
return;
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!remoteUrl.includes('github.com')) {
|
if (!remoteUrl.includes('github.com')) {
|
||||||
@@ -48,13 +47,13 @@ function checkVisibility() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let ownerRepo;
|
let ownerRepo;
|
||||||
|
|
||||||
if (remoteUrl.startsWith('https://github.com/')) {
|
if (remoteUrl.startsWith('https://github.com/')) {
|
||||||
ownerRepo = remoteUrl.slice('https://github.com/'.length);
|
ownerRepo = remoteUrl.slice('https://github.com/'.length);
|
||||||
} else if (remoteUrl.startsWith('git@github.com:')) {
|
} else if (remoteUrl.startsWith('git@github.com:')) {
|
||||||
ownerRepo = remoteUrl.slice('git@github.com:'.length);
|
ownerRepo = remoteUrl.slice('git@github.com:'.length);
|
||||||
} else {
|
} else {
|
||||||
console.error('Unsupported GitHub URL format');
|
return;
|
||||||
process.exit(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ownerRepo = ownerRepo.replace(/\.git$/, '');
|
ownerRepo = ownerRepo.replace(/\.git$/, '');
|
||||||
|
|||||||
Reference in New Issue
Block a user