commit
5080f2e5cd
1 changed files with 8 additions and 1 deletions
|
|
@ -19,7 +19,14 @@ namespace BSB.Commands.script
|
||||||
{
|
{
|
||||||
string attempt_endpoint = args[0];
|
string attempt_endpoint = args[0];
|
||||||
|
|
||||||
if(attempt_endpoint.Contains("https://github.com/"))
|
Uri uriResult;
|
||||||
|
bool urlValid = Uri.TryCreate(attempt_endpoint, UriKind.Absolute, out uriResult)
|
||||||
|
&& (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps);
|
||||||
|
if(urlValid == false)
|
||||||
|
{
|
||||||
|
return Failed("Url >" + attempt_endpoint + "< is not a valid URL");
|
||||||
|
}
|
||||||
|
if (attempt_endpoint.Contains("https://github.com/"))
|
||||||
{
|
{
|
||||||
attempt_endpoint = attempt_endpoint.Replace("https://github.com/", "https://raw.githubusercontent.com/");
|
attempt_endpoint = attempt_endpoint.Replace("https://github.com/", "https://raw.githubusercontent.com/");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue