-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#608] Windows fix for <app> console #626
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
## 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) | ||
|
||
$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") | ||
|
||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My impression was that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. possibly I'm incorrect but I was under the assumption that the two were identical, in the case that they are not, it may be a good idea to have an optional config flag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own edification, could you explain the changes here? I'm going to merge them, I'd just like to know what I need to be doing differently or how I should be reasoning about quoting here; I'm working with PS Core for the most part, and I know there are differences with previous versions of PS, but from a maintenance standpoint I can't work with both, so Core is what I've stuck with, do these changes make any assumptions in that regard?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, the difference here is that we wrap the
$boot
in quotes so that paths containing a space work as intended, rather than acting as independent args 👍we also wrap the other args in quotes just in case