@@ -16,7 +16,7 @@ $self = Split-Path -Leaf $MyInvocation.MyCommand.Path
16
16
$projectDirectory = Split-Path $MyInvocation.MyCommand.Path
17
17
$libgit2Directory = Join-Path $projectDirectory " libgit2"
18
18
19
- function Run -Command ([scriptblock ]$Command , [switch ]$Fatal , [switch ]$Quiet ) {
19
+ function Invoke -Command ([scriptblock ]$Command , [switch ]$Fatal , [switch ]$Quiet ) {
20
20
$output = " "
21
21
if ($Quiet ) {
22
22
$output = & $Command 2>&1
@@ -67,18 +67,18 @@ Push-Location $libgit2Directory
67
67
$git = Find-Git
68
68
69
69
Write-Output " Fetching..."
70
- Run - Command - Quiet { & $git fetch }
70
+ Invoke -Command - Quiet { & $git fetch }
71
71
72
72
Write-Output " Verifying $sha ..."
73
73
$sha = & $git rev- parse $sha
74
74
if ($LASTEXITCODE -ne 0 ) {
75
75
write-host - foregroundcolor red " Error: invalid SHA. USAGE: $self <SHA>"
76
- popd
76
+ Pop-Location
77
77
break
78
78
}
79
79
80
80
Write-Output " Checking out $sha ..."
81
- Run - Command - Quiet - Fatal { & $git checkout $sha }
81
+ Invoke -Command - Quiet - Fatal { & $git checkout $sha }
82
82
83
83
Pop-Location
84
84
@@ -88,7 +88,7 @@ Push-Location $libgit2Directory
88
88
$binaryFilename = " git2-" + $sha.Substring (0 , 7 )
89
89
}
90
90
91
- sc - Encoding ASCII (Join-Path $projectDirectory " nuget.package\libgit2\libgit2_hash.txt" ) $sha
91
+ Set-Content - Encoding ASCII (Join-Path $projectDirectory " nuget.package\libgit2\libgit2_hash.txt" ) $sha
92
92
93
93
$buildProperties = @"
94
94
<Project>
@@ -99,7 +99,7 @@ Push-Location $libgit2Directory
99
99
</Project>
100
100
"@
101
101
102
- sc - Encoding UTF8 (Join-Path $projectDirectory " nuget.package\build\LibGit2Sharp.NativeBinaries.props" ) $buildProperties
102
+ Set-Content - Encoding UTF8 (Join-Path $projectDirectory " nuget.package\build\LibGit2Sharp.NativeBinaries.props" ) $buildProperties
103
103
104
104
$net40BuildProperties = @"
105
105
<Project>
@@ -140,7 +140,7 @@ Push-Location $libgit2Directory
140
140
</Project>
141
141
"@
142
142
143
- sc - Encoding UTF8 (Join-Path $projectDirectory " nuget.package\build\net40\LibGit2Sharp.NativeBinaries.props" ) $net40BuildProperties
143
+ Set-Content - Encoding UTF8 (Join-Path $projectDirectory " nuget.package\build\net40\LibGit2Sharp.NativeBinaries.props" ) $net40BuildProperties
144
144
145
145
$dllConfig = @"
146
146
<configuration>
@@ -149,7 +149,7 @@ Push-Location $libgit2Directory
149
149
</configuration>
150
150
"@
151
151
152
- sc - Encoding UTF8 (Join-Path $projectDirectory " nuget.package\libgit2\LibGit2Sharp.dll.config" ) $dllConfig
152
+ Set-Content - Encoding UTF8 (Join-Path $projectDirectory " nuget.package\libgit2\LibGit2Sharp.dll.config" ) $dllConfig
153
153
154
154
Write-Output " Done!"
155
155
}
0 commit comments