From 2192c31a643edd2b24c63a8b9f6482ba27a211ab Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Wed, 15 Jun 2016 13:27:32 -0700 Subject: [PATCH] Fix use of aliases in build.psm1 Also use git-dir to make Copy-MappedFiles location agnostic. --- build.psm1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.psm1 b/build.psm1 index ed1709f39..f830a5d71 100644 --- a/build.psm1 +++ b/build.psm1 @@ -697,7 +697,7 @@ function Copy-MappedFiles { # Do some intelligens to prevent shouting us in the foot with CL management # finding base-line CL - $cl = git tag | % {if ($_ -match 'SD.(\d+)$') {[int]$Matches[1]} } | sort -Descending | select -First 1 + $cl = git --git-dir="$PSScriptRoot/.git" tag | % {if ($_ -match 'SD.(\d+)$') {[int]$Matches[1]} } | Sort-Object -Descending | Select-Object -First 1 if ($cl) { Write-Host -ForegroundColor Green "Current base-line CL is SD:$cl (based on tags)" @@ -743,15 +743,15 @@ function Copy-MappedFiles { end { $map.GetEnumerator() | % { - mkdir (Split-Path $_.Value) -ErrorAction SilentlyContinue > $null + New-Item -ItemType Directory (Split-Path $_.Value) -ErrorAction SilentlyContinue > $null if ($PSBoundParameters['Verbose']) { - cp $_.Key $_.Value -Verbose + Copy-Item $_.Key $_.Value -Verbose } else { - cp $_.Key $_.Value + Copy-Item $_.Key $_.Value } } } @@ -799,7 +799,7 @@ function Get-Mappings { $map = @{} $mapFiles | % { - $rawHashtable = $_ | cat -Raw | ConvertFrom-Json | Convert-PSObjectToHashtable + $rawHashtable = $_ | Get-Content -Raw | ConvertFrom-Json | Convert-PSObjectToHashtable $mapRoot = Split-Path $_.FullName if ($KeepRelativePaths) { @@ -860,7 +860,7 @@ function Send-GitDiffToSd { Set-Content -Value $diff -Path $env:TEMP\diff -Encoding Ascii if ($WhatIf) { Write-Host -Foreground Green "Patch content" - cat $env:TEMP\diff + Get-Content $env:TEMP\diff } else { & $patchPath --binary -p1 $sdFilePath $env:TEMP\diff }