summaryrefslogtreecommitdiff
path: root/bin/mix.ps1
blob: 369c4942113323903b67d2f4a5255d8db1200683 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Store path to mix.bat as a FileInfo object
$mixBatPath = (Get-ChildItem (((Get-ChildItem $MyInvocation.MyCommand.Path).Directory.FullName) + '\mix.bat'))
$newArgs = @()

for ($i = 0; $i -lt $args.length; $i++)
{
  if ($args[$i] -is [array])
  {
    # Commas created the array so we need to reintroduce those commas
    for ($j = 0; $j -lt $args[$i].length - 1; $j++)
    {
      $newArgs += ($args[$i][$j] + ',')
    }
    $newArgs += $args[$i][-1]
  }
  else
  {
    $newArgs += $args[$i]
  }
}

# Corrected arguments are ready to pass to batch file
& $mixBatPath $newArgs