bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 397 forks source link

[windows] Script fix for <app> foreground #610

Open artman41 opened 5 years ago

artman41 commented 5 years ago

Previously on an <app> foreground, the task information would show but no input and no shell would show either meaning that the redirected output was invisble.

By changing the script to resemble the following, the node is started and can be interacted with

## This command starts the release in the foreground, i.e.
## standard out is routed to the current terminal session.

require-cookie

# Start the VM, executing pre and post start hooks
run-hooks -Phase pre_start

$boot = (join-path $Env:REL_DIR $Env:REL_NAME)

# Build argument vector for erl
$erl_opts = @()
if ($Env:ERL_OPTS -ne $null) {
    $erl_opts = string-to-argv -String $Env:ERL_OPTS
}
$extra_opts = @()
if ($Env:EXTRA_OPTS -ne $null) {
    $extra_opts = string-to-argv -String $Env:EXTRA_OPTS
}

#$argv = @("-noshell", "-noinput", "+Bd")
$argv += @("-boot", $boot)
$argv += @("-args_file", "$Env:VMARGS_PATH")
$argv += @("-mode", "embedded")
$argv += $erl_opts
$argv += "-extra"
$argv += $extra_opts
$argv += $args

run-hooks -Phase post_start

iex "erl $argv"
bitwalker commented 5 years ago

Could you submit this as a PR? I'd like to have an exact diff so I can see the changes better without accidentally missing something or introducing my own changes into the mix.