Skip to content

Commit

Permalink
CLI: CmdHelper should be working even the directory has 'space' chara…
Browse files Browse the repository at this point in the history
…cters.
  • Loading branch information
EngincanV committed Oct 3, 2024
1 parent 500c483 commit 736f0c0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ public CmdHelper(IOptionsSnapshot<AbpCliOptions> cliOptions)

public void Open(string pathOrUrl)
{
//directory might contain 'space' character
pathOrUrl = pathOrUrl.EnsureStartsWith('"');
pathOrUrl = pathOrUrl.EnsureEndsWith('"');

if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
pathOrUrl = pathOrUrl.Replace("&", "^&");
Process.Start(new ProcessStartInfo("cmd", $"/c start {pathOrUrl}") { CreateNoWindow = true });
Process.Start(new ProcessStartInfo("cmd", $"/c start \"\" {pathOrUrl}") { CreateNoWindow = true });
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Expand Down

0 comments on commit 736f0c0

Please sign in to comment.