Merge pull request #13912 from abpframework/cli-cmdhelper-rename-openwebpage

Cli: Renamed ICmdHelper.OpenWebPage to ICmdHelper.Open
pull/12393/head^2
Halil İbrahim Kalkan 3 years ago committed by GitHub
commit d7fa11663d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -333,14 +333,14 @@ public abstract class ProjectCreationCommandBase
var tieredYesNo = tiered ? "yes" : "no";
var url = $"https://{urlPrefix}.abp.io/project-created-success?ui={uiFramework:g}&db={databaseProvider:g}&tiered={tieredYesNo}";
CmdHelper.OpenWebPage(url);
CmdHelper.Open(url);
}
protected void OpenMicroserviceDocumentPage()
{
var url = "https://docs.abp.io/en/commercial/latest/startup-templates/microservice/index";
CmdHelper.OpenWebPage(url);
CmdHelper.Open(url);
}
protected bool GetCreateSolutionFolderPreference(CommandLineArgs commandLineArgs)

@ -153,7 +153,7 @@ public class SolutionModuleAdder : ITransientDependency
var documentationLink = module.GetFirstDocumentationLinkOrNull();
if (documentationLink != null)
{
CmdHelper.OpenWebPage(documentationLink);
CmdHelper.Open(documentationLink);
}
return module;

@ -18,20 +18,20 @@ public class CmdHelper : ICmdHelper, ITransientDependency
CliOptions = cliOptions.Value;
}
public void OpenWebPage(string url)
public void Open(string pathOrUrl)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
url = url.Replace("&", "^&");
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}") { CreateNoWindow = true });
pathOrUrl = pathOrUrl.Replace("&", "^&");
Process.Start(new ProcessStartInfo("cmd", $"/c start {pathOrUrl}") { CreateNoWindow = true });
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url);
Process.Start("xdg-open", pathOrUrl);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url);
Process.Start("open", pathOrUrl);
}
}

@ -4,7 +4,7 @@ namespace Volo.Abp.Cli.Utils;
public interface ICmdHelper
{
void OpenWebPage(string url);
void Open(string pathOrUrl);
void Run(string file, string arguments);

Loading…
Cancel
Save