Packages
relx
4.4.0
4.10.0
4.9.0
4.8.0
4.7.0
4.6.0
4.5.0
4.4.0
4.3.0
4.2.0
4.1.0
4.0.2
4.0.1
4.0.0
4.0.0-rc2
3.33.0
3.32.1
3.32.0
3.31.0
3.30.0
3.29.0
3.28.0
3.27.0
3.26.0
3.25.0
3.24.4
3.24.3
3.24.2
3.24.1
3.23.1
3.23.0
3.22.4
3.22.3
retired
3.22.2
3.22.1
retired
3.22.0
3.21.1
3.21.0
3.20.0
3.19.0
3.18.0
3.17.0
3.16.0
3.15.0
3.14.0
3.13.0
3.12.0
3.11.0
3.10.0
3.9.0
3.8.0
3.7.1
3.7.0
3.6.0
3.5.0
3.4.0
3.3.2
3.3.1
3.3.0
3.2.0
3.1.0
3.0.0
2.1.1
2.1.0
Release assembler for Erlang/OTP Releases
Current section
Files
Jump to
Current section
Files
priv/templates/bin_windows_ps
#! /usr/bin/pwsh
# This is a simple start script file that runs the release in an Erlang shell
# Terminate on error
$ErrorActionPreference = "Stop"
# Set variables that describe the release
$rel_name = '{{ rel_name }}'
$rel_vsn = '{{ rel_vsn }}'
$erts_vsn = '{{ erts_vsn }}'
$erl_opts = '{{ erl_opts }}'
# export these to match mix release environment variables
$RELEASE_NAME = '{{ rel_name }}'
$RELEASE_VERSION = '{{ rel_vsn }}'
$RELEASE_PROG = $MyInvocation.MyCommand.Name
# Ensure we have PSScriptRoot
if (!(Test-Path variable:global:PSScriptRoot)) {
# Support for powershell 2.0
$PSScriptRoot = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition
}
# Import psutil helper functions
. $PSScriptRoot\psutil.ps1
# Set the root release directory based on the location of this script
$rootdir = Split-Path -Parent -Path $PSScriptRoot
$rel_dir = "$rootdir\releases\$rel_vsn"
$erts_root, $erts_dir = Find-ERTS -RelRoot $rootdir -Vsn $erts_vsn
$sys_config = Find-FormatConfig -RelDir $rel_dir -File 'sys.config'
$vm_args = Find-FormatConfig -RelDir $rel_dir -File 'vm.args'
$boot_script = Find-BootScript -RelDir $rel_dir -RelName $rel_name
$werl = "$erts_dir\bin\werl.exe"
# Set the ERL_LIBS environment variable
$env:ERL_LIBS = "$rootdir\lib"
# Start the release in an `erl` shell
$params = @($erl_opts, '-boot', $boot_script)
if (![string]::IsNullOrEmpty($sys_config)) { $params += '-config', $sys_config }
if (![string]::IsNullOrEmpty($vm_args)) { $params += '-args_file', $vm_args }
$params += $args
& $werl $params
# Cleanup
$env:ERL_LIBS = ''