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