@@ -10,12 +10,8 @@ function Push-CompilerSpecificFiles {
1010 $Language
1111 )
1212
13- $context = @ ()
14-
15-
1613 # for each file, move it to a temporary location
1714 foreach ($f in $FileSet ){
18-
1915 #
2016 # Convention is as follows:
2117 #
@@ -35,27 +31,30 @@ function Push-CompilerSpecificFiles {
3531 # file afterwards.
3632
3733 # transform the compiler specific file to the generic one
38- $originFile = Get-Item $f.FullName.Replace (" .$Configuration " , " " )
34+ $originFilePath = $f.FullName.Replace (" .$Configuration " , " " )
3935
4036 # IF it exists, copy the originFile to a temp location and replace it
4137 # with the specific file.
42- if ($originFile.Exists ){
38+ if (Test-Path $originFilePath ){
39+
40+ $originFile = Get-Item $originFilePath
41+
4342 Write-Host " Moving generic file $originFile to $tmp ..."
4443 Move-Item - Force - Path $originFile - Destination $tmp
4544 Write-Host " Copying $f to generic file $originFile "
46- Copy-Item - Path $f - Destination $originFile
45+ Copy-Item - Path $f - Destination $originFile
4746
48- $context += @ {" origin" = $originFile ; " temp" = $tmp ;}
47+ @ {" origin" = $originFile ; " temp" = $tmp ;}
4948 }else {
49+
50+ $originFile = New-Item $originFilePath
51+
5052 Write-Host " Copying $f to generic file $originFile "
51- Copy-Item - Path $f - Destination $originFile
53+ Copy-Item - Path $f - Destination $originFile
5254
53- # we set $temp to $null since we don't want to copy anything
55+ # we set $temp to $null since we don't want to copy anything
5456 # back
55- $context += @ {" origin" = $originFile ; " temp" = $null ;}
57+ @ {" origin" = $originFile ; " temp" = $null ;}
5658 }
5759 }
58-
59- return $context
60-
6160}
0 commit comments