-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
"origin" doesn't really make sense, as it is just the name of the default remote for most repos "remote" is more correct in the context of the code
- Loading branch information
Showing
13 changed files
with
116 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import parseRepoURL from 'parse-github-url' | ||
|
||
import { cmd } from './utils' | ||
|
||
export async function fetchRemote (name) { | ||
const remoteURL = await cmd(`git config --get remote.${name}.url`) | ||
if (!remoteURL) { | ||
console.warn(`Warning: Git remote ${name} was not found`) | ||
console.warn(`Warning: Changelog will not contain links to commits, issues, or PRs`) | ||
return null | ||
} | ||
const remote = parseRepoURL(remoteURL) | ||
const protocol = remote.protocol === 'http:' ? 'http:' : 'https:' | ||
const hostname = remote.hostname || remote.host | ||
return { | ||
hostname, | ||
url: `${protocol}//${hostname}/${remote.repo}` | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.