From 8b7c20471d8276c02d1b208c985c09dccbcae19c Mon Sep 17 00:00:00 2001 From: Tyler Hughes Date: Thu, 10 Jan 2019 00:18:17 +0000 Subject: [PATCH 1/2] Modified console.ps1 to execute the application inside the current powershell window --- priv/libexec/commands/win/console.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/priv/libexec/commands/win/console.ps1 b/priv/libexec/commands/win/console.ps1 index b290e62e..1b21c16a 100644 --- a/priv/libexec/commands/win/console.ps1 +++ b/priv/libexec/commands/win/console.ps1 @@ -1,6 +1,6 @@ ## Run the app in console mode $bin = whereis-erts-bin -$werl = (join-path $bin werl) +$erl = (join-path $bin "erl.exe") #get erl.exe as werl.exe will open a new window $boot = (join-path $Env:REL_DIR $Env:REL_NAME) @@ -18,6 +18,6 @@ $post_start = { } # Run post-start hooks asynchronously -start-job -Name "post_start hooks" -ScriptBlock $post_start +start-job -Name "post_start hooks" -ScriptBlock $post_start | out-null # hide the output from start-job -& $werl @argv +start-process "$erl" -ArgumentList "$argv" -Wait -NoNewWindow #execute the application in the current shell window From 949970ac262fa8b21dba38ff34c2191cb9fd1eba Mon Sep 17 00:00:00 2001 From: Tyler Hughes Date: Thu, 10 Jan 2019 01:39:52 +0000 Subject: [PATCH 2/2] [windows] Added support for paths containing spaces --- priv/libexec/commands/win/console.ps1 | 6 +++--- priv/templates/release_rc_win_exec.eex | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/priv/libexec/commands/win/console.ps1 b/priv/libexec/commands/win/console.ps1 index 1b21c16a..f44d607e 100644 --- a/priv/libexec/commands/win/console.ps1 +++ b/priv/libexec/commands/win/console.ps1 @@ -4,9 +4,9 @@ $erl = (join-path $bin "erl.exe") #get erl.exe as werl.exe will open a new windo $boot = (join-path $Env:REL_DIR $Env:REL_NAME) -$argv = @("-boot", $boot) -$argv += @("-config", $Env:SYS_CONFIG_PATH) -$argv += @("-args_file", $Env:VMARGS_PATH) +$argv = @("-boot", "`"$boot`"") +$argv += @("-config", "`"$Env:SYS_CONFIG_PATH`"") +$argv += @("-args_file", "`"$Env:VMARGS_PATH`"") $argv += @("-user", "Elixir.IEx.CLI") $argv += @("-extra", "--no-halt", "+iex") diff --git a/priv/templates/release_rc_win_exec.eex b/priv/templates/release_rc_win_exec.eex index 07882f0d..a9c49e27 100644 --- a/priv/templates/release_rc_win_exec.eex +++ b/priv/templates/release_rc_win_exec.eex @@ -15,4 +15,5 @@ where pwsh >nul 2>nul if %ERRORLEVEL% equ 0 ( set prog=pwsh ) -%prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& "%boot_script%" @args" %* +%prog% -NonInteractive -NoProfile -ExecutionPolicy Bypass -Command "& '%boot_script%' @args" %* +