=Fixed some errors in Setup-ScriptEnv
This commit is contained in:
parent
1b3a16806a
commit
50d9aef264
|
@ -370,14 +370,14 @@ function _Init {
|
||||||
git pull
|
git pull
|
||||||
} elseif ( $PSCmdlet.ShouldProcess("Pull git repo from $GitURL into $MyPSScriptRoot ?") ) {
|
} elseif ( $PSCmdlet.ShouldProcess("Pull git repo from $GitURL into $MyPSScriptRoot ?") ) {
|
||||||
$local:tmpGitDir = New-TemporaryFile
|
$local:tmpGitDir = New-TemporaryFile
|
||||||
Remove-Item $tmpGitDir
|
Remove-Item $tmpGitDir -Confirm:$flase -Force
|
||||||
New-Item -Type Directory $tmpGitDir.FullName | Out-Null
|
New-Item -Type Directory $tmpGitDir.FullName | Out-Null
|
||||||
Write-Verbose "Cloning git repo [$GitURL] into temporary location ('$($tmpGitDir.FullName)')..."
|
Write-Verbose "Cloning git repo [$GitURL] into temporary location ('$($tmpGitDir.FullName)')..."
|
||||||
$local:GitOutput = "$(& git clone $GitURL $tmpGitDir.FullName --no-checkout)"
|
$local:GitOutput = "$(& git clone $GitURL $tmpGitDir.FullName --no-checkout)"
|
||||||
Write-Verbose $GitOutput
|
Write-Verbose $GitOutput
|
||||||
Write-Verbose "Moving git repo from temp location to $MyPSScriptRoot . . ."
|
Write-Verbose "Moving git repo from temp location to $MyPSScriptRoot . . ."
|
||||||
Copy-Item -Recurse (Join-Path $tmpGitDir.FullName .git) ./.git
|
Copy-Item -Force -Recurse (Join-Path $tmpGitDir.FullName .git) ./.git
|
||||||
Remove-Item $tmpGitDir.FullName
|
Remove-Item $tmpGitDir.FullName -Recurse -Force -Confirm:$false
|
||||||
Write-Verbose "Checking out repo..."
|
Write-Verbose "Checking out repo..."
|
||||||
$GitOutput = "$(& git checkout --force)"
|
$GitOutput = "$(& git checkout --force)"
|
||||||
Write-Verbose $GitOutput
|
Write-Verbose $GitOutput
|
||||||
|
|
Loading…
Reference in New Issue