Skip to content

Commit 88c75bc

Browse files
committed
Remove powershell scripts
It current leaves the shell broken after quitting Erlang. Issues have been reported upstream, so we may be able to bring it back in future Erlang/OTP versions.
1 parent 786f3ce commit 88c75bc

File tree

5 files changed

+22
-350
lines changed

5 files changed

+22
-350
lines changed

Diff for: bin/elixir.ps1

-271
This file was deleted.

Diff for: bin/elixirc.ps1

-35
This file was deleted.

Diff for: bin/iex.ps1

-30
This file was deleted.

Diff for: bin/mix.ps1

+21-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1-
#!/usr/bin/env pwsh
1+
# Store path to mix.bat as a FileInfo object
2+
$mixBatPath = (Get-ChildItem (((Get-ChildItem $MyInvocation.MyCommand.Path).Directory.FullName) + '\mix.bat'))
3+
$newArgs = @()
24

3-
$scriptPath = Split-Path -Parent $PSCommandPath
4-
$elixirMainScript = Join-Path -Path $scriptPath -ChildPath "elixir.ps1"
5+
for ($i = 0; $i -lt $args.length; $i++)
6+
{
7+
if ($args[$i] -is [array])
8+
{
9+
# Commas created the array so we need to reintroduce those commas
10+
for ($j = 0; $j -lt $args[$i].length - 1; $j++)
11+
{
12+
$newArgs += ($args[$i][$j] + ',')
13+
}
14+
$newArgs += $args[$i][-1]
15+
}
16+
else
17+
{
18+
$newArgs += $args[$i]
19+
}
20+
}
521

6-
$mixFile = Join-Path -Path $scriptPath -ChildPath "mix"
7-
8-
$prependedArgs = @($mixFile)
9-
10-
$allArgs = $prependedArgs + $args
11-
12-
# The dot is going to evaluate the script with the vars defined here.
13-
. $elixirMainScript
22+
# Corrected arguments are ready to pass to batch file
23+
& $mixBatPath $newArgs

Diff for: lib/elixir/test/elixir/kernel/cli_test.exs

+1-3
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ end
6464
test_parameters =
6565
if(PathHelpers.windows?(),
6666
do: [%{cli_extension: ".bat"}],
67-
else:
68-
[%{cli_extension: ""}] ++
69-
if(System.find_executable("pwsh"), do: [%{cli_extension: ".ps1"}], else: [])
67+
else: [%{cli_extension: ""}]
7068
)
7169

7270
defmodule Kernel.CLI.ExecutableTest do

0 commit comments

Comments
 (0)