Skip to content

Commit 1a93d35

Browse files
committed
Initial PowerShell script addressing mix commas
1 parent 06cc1c1 commit 1a93d35

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

bin/mix.ps1

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Initialize with path to mix.bat relative to caller's working directory
2+
$toCmd = '' + (Resolve-Path -relative (Split-Path $MyInvocation.MyCommand.Path)) + '\mix.bat'
3+
4+
foreach ($arg in $args)
5+
{
6+
$toCmd += ' '
7+
8+
if ($arg -is [array])
9+
{
10+
# Commas created the array so we need to reintroduce those commas
11+
for ($i = 0; $i -lt $arg.length; $i++)
12+
{
13+
$toCmd += $arg[$i]
14+
if ($i -ne ($arg.length - 1))
15+
{
16+
$toCmd += ', '
17+
}
18+
}
19+
}
20+
else
21+
{
22+
$toCmd += $arg
23+
}
24+
}
25+
26+
# Corrected arguments are ready to pass to batch file
27+
cmd /c $toCmd

0 commit comments

Comments
 (0)