mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-31 09:18:38 +00:00
Add param to include HTTPS prefix in DetermineRemoteUrl method
This commit is contained in:
parent
7edef5010d
commit
c63284cb37
2 changed files with 6 additions and 3 deletions
|
@ -192,7 +192,7 @@
|
||||||
<div class="ui black attached inverted segment">
|
<div class="ui black attached inverted segment">
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
@{
|
@{
|
||||||
string? remoteUrl = VersionHelper.DetermineRemoteUrl();
|
string? remoteUrl = VersionHelper.DetermineRemoteUrl(false);
|
||||||
}
|
}
|
||||||
<span>
|
<span>
|
||||||
@Model.Translate(BaseLayoutStrings.GeneratedBy, VersionHelper.FullVersion)
|
@Model.Translate(BaseLayoutStrings.GeneratedBy, VersionHelper.FullVersion)
|
||||||
|
|
|
@ -52,7 +52,8 @@ public static class VersionHelper
|
||||||
/// Determines the URL of the git remote. This doesn't return a complete URL and it's only really used for the
|
/// Determines the URL of the git remote. This doesn't return a complete URL and it's only really used for the
|
||||||
/// "Source Code" hyperlink in the BaseLayout. Use this with caution.
|
/// "Source Code" hyperlink in the BaseLayout. Use this with caution.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string? DetermineRemoteUrl()
|
/// <param name="includePrefix">Include the "https://" prefix in the returned URL.</param>
|
||||||
|
public static string? DetermineRemoteUrl(bool includePrefix = true)
|
||||||
{
|
{
|
||||||
string? remoteUnparsedUrl = null;
|
string? remoteUnparsedUrl = null;
|
||||||
string? remoteParsedUrl = null;
|
string? remoteParsedUrl = null;
|
||||||
|
@ -66,7 +67,9 @@ public static class VersionHelper
|
||||||
}
|
}
|
||||||
else if (remoteUnparsedUrl.Contains("https://"))
|
else if (remoteUnparsedUrl.Contains("https://"))
|
||||||
{
|
{
|
||||||
remoteParsedUrl = remoteUnparsedUrl.Replace("https://", "").Split(".git").FirstOrDefault();
|
remoteParsedUrl = includePrefix
|
||||||
|
? remoteUnparsedUrl.Split(".git").FirstOrDefault()
|
||||||
|
: remoteUnparsedUrl.Replace("https://", "").Split(".git").FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
return remoteParsedUrl;
|
return remoteParsedUrl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue