1
1
# !/usr/bin/env pwsh
2
2
3
+ $ELIXIR_VERSION = " 1.17.0-dev"
4
+
3
5
$MinPowerShellVersion = [version ]" 7.2.0"
4
6
5
7
if ($MinPowerShellVersion.CompareTo ([version ]$PSVersionTable.PSVersion ) -eq 1 ) {
6
8
Write-Error " This script requires PowerShell version 7.2 or above. Running on $ ( $PSVersionTable.PSVersion ) "
7
9
}
8
10
9
- $ELIXIR_VERSION = " 1.17.0-dev"
10
11
$ScriptPath = Split-Path - Parent $PSCommandPath
11
12
$ErlExec = " erl"
12
13
@@ -20,7 +21,7 @@ Usage: $ScriptName [options] [.exs file] [data]
20
21
-e "COMMAND" Evaluates the given command (*)
21
22
-h, --help Prints this message (standalone)
22
23
-r "FILE" Requires the given files/patterns (*)
23
- -S SCRIPT Finds and executes the given script in \ $PATH
24
+ -S SCRIPT Finds and executes the given script in ` $ PATH
24
25
-pr "FILE" Requires the given files/patterns in parallel (*)
25
26
-pa "PATH" Prepends the given path to Erlang code path (*)
26
27
-pz "PATH" Appends the given path to Erlang code path (*)
@@ -32,10 +33,9 @@ Usage: $ScriptName [options] [.exs file] [data]
32
33
--logger-sasl-reports BOOL Enables or disables SASL reporting
33
34
--no-halt Does not halt the Erlang VM after execution
34
35
--short-version Prints Elixir version (standalone)
35
- --werl Uses Erlang's Windows shell GUI (Windows only)
36
36
37
37
Options given after the .exs file or -- are passed down to the executed code.
38
- Options can be passed to the Erlang runtime using \ $ELIXIR_ERL_OPTIONS or --erl.
38
+ Options can be passed to the Erlang runtime using ` $ ELIXIR_ERL_OPTIONS or --erl.
39
39
40
40
## Distribution options
41
41
@@ -54,7 +54,7 @@ The following options are related to node distribution.
54
54
The following options are generally used under releases.
55
55
56
56
--boot "FILE" Uses the given FILE.boot to start the system
57
- --boot-var VAR "VALUE" Makes \ $VAR available as VALUE to FILE.boot (*)
57
+ --boot-var VAR "VALUE" Makes ` $ VAR available as VALUE to FILE.boot (*)
58
58
--erl-config "FILE" Loads configuration in FILE.config written in Erlang (*)
59
59
--pipe-to "PIPEDIR" "LOGDIR" Starts the Erlang VM as a named PIPEDIR and LOGDIR
60
60
--vm-args "FILE" Passes the contents in file as arguments to the VM
@@ -87,7 +87,7 @@ function NormalizeArg {
87
87
[Parameter (Mandatory = $true , ValueFromPipeline = $true )]
88
88
[string []] $Items
89
89
)
90
- [ string ]::Join( " ," , $Items )
90
+ $Items -join " ,"
91
91
}
92
92
93
93
function QuotedString {
@@ -197,7 +197,7 @@ for ($i = 0; $i -lt $Args.Count; $i++) {
197
197
" --logger-sasl-reports" {
198
198
$private :TempVal = $Args [$i + 1 ]
199
199
if ($TempVal -in @ (" true" , " false" )) {
200
- $ErlangParams.AddRange ([string []]@ (" -logger" , " handle_sasl " , $Args [++ $i ]))
200
+ $ErlangParams.AddRange ([string []]@ (" -logger" , " handle_sasl_reports " , $Args [++ $i ]))
201
201
}
202
202
break
203
203
}
@@ -207,13 +207,6 @@ for ($i = 0; $i -lt $Args.Count; $i++) {
207
207
break
208
208
}
209
209
210
- " --werl" {
211
- if ($IsWindows ) {
212
- $ErlExec = " werl"
213
- }
214
- break
215
- }
216
-
217
210
" +iex" {
218
211
$ElixirParams.Add (" +iex" )
219
212
$UseIex = $true
@@ -301,15 +294,6 @@ for ($i = 0; $i -lt $Args.Count; $i++) {
301
294
}
302
295
}
303
296
304
- # Support for ANSI is only disable if TERM or NO_COLOR env vars are set.
305
- # This will change the $PSStyle.OutputRendering property.
306
- if ($PSStyle.OutputRendering -ne " PlainText" ) {
307
- # TODO: find a way to detect if the term is interactive on Windows.
308
- if ($IsWindows -or (test - t 1 - a - t 2 )) {
309
- $BeforeExtras.InsertRange (0 , [string []]@ (" -elixir" , " ansi_enabled" , " true" ))
310
- }
311
- }
312
-
313
297
if ($null -eq $UseIEx ) {
314
298
$BeforeExtras.InsertRange (0 , [string []]@ (" -s" , " elixir" , " start_cli" ))
315
299
}
@@ -347,7 +331,7 @@ if ($ERTS_BIN) {
347
331
}
348
332
349
333
if ($null -eq $RunErlPipe ) {
350
- $ParamsPart = [ string ]::Join( " " , $AllParams )
334
+ $ParamsPart = $AllParams -join " "
351
335
}
352
336
else {
353
337
$private :OrigBinPath = $BinPath
0 commit comments