mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Handle HTTPS Git clone URLs
This commit is contained in:
+12
-6
@@ -9,13 +9,19 @@ function getGitCommit() {
|
||||
}
|
||||
|
||||
function getGitHubURL() {
|
||||
// TODO potentially replac this with an fb.me URL (if it can forward the query params)
|
||||
return execSync('git remote get-url origin')
|
||||
// TODO potentially replace this with an fb.me URL (assuming it can forward the query params)
|
||||
const url = execSync('git remote get-url origin')
|
||||
.toString()
|
||||
.trim()
|
||||
.replace(':', '/')
|
||||
.replace('git@', 'https://')
|
||||
.replace('.git', '');
|
||||
.trim();
|
||||
|
||||
if (url.startsWith('https://')) {
|
||||
return url.replace('.git', '');
|
||||
} else {
|
||||
return url
|
||||
.replace(':', '/')
|
||||
.replace('git@', 'https://')
|
||||
.replace('.git', '');
|
||||
}
|
||||
}
|
||||
|
||||
function getVersionString() {
|
||||
|
||||
Reference in New Issue
Block a user