We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ed1cc1 commit 4a5aa0eCopy full SHA for 4a5aa0e
create-pull-request.js
@@ -8,14 +8,16 @@ const error = chalk.keyword("red");
8
9
(async () => {
10
try {
11
- const remoteOriginUrl = await gitRemoteOriginUrl();
+ let remoteOriginUrl = await gitRemoteOriginUrl();
12
13
- const repoUrl = remoteOriginUrl
14
- .replace(":", "/")
15
- .replace(/^git@/, "https://")
16
- .replace(/\.git$/, "");
+ if (remoteOriginUrl.startsWith("git@")) {
+ remoteOriginUrl = remoteOriginUrl
+ .replace(/^git@/, "https://")
+ .replace(/(com|org):/, "$1/");
17
+ }
18
- const pullRequestURL = getPullRequestUrl(repoUrl);
19
+ remoteOriginUrl = remoteOriginUrl.replace(/\.git$/, "");
20
+ const pullRequestURL = getPullRequestUrl(remoteOriginUrl);
21
if (!pullRequestURL) {
22
return;
23
}
0 commit comments