update
This commit is contained in:
16
update.ps1
16
update.ps1
@@ -28,9 +28,12 @@ $token = (Get-Content $TokenFile -Raw).Trim()
|
||||
|
||||
# Fetch remote
|
||||
Set-Location $RepoPath
|
||||
git -c credential.helper="" fetch "https://gomag-vending:$token@gitea.romfast.ro/romfast/gomag-vending.git" main 2>&1 | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Log "EROARE: git fetch esuat!" "Red"
|
||||
$fetchUrl = "https://gomag-vending:$token@gitea.romfast.ro/romfast/gomag-vending.git"
|
||||
$env:GIT_TERMINAL_PROMPT = "0"
|
||||
$fetchOutput = & git -c credential.helper="" fetch $fetchUrl main 2>&1
|
||||
$fetchExit = $LASTEXITCODE
|
||||
if ($fetchExit -ne 0) {
|
||||
Log "EROARE: git fetch esuat (exit=$fetchExit): $fetchOutput" "Red"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -52,9 +55,10 @@ if (-not $Silent) {
|
||||
|
||||
# Git pull
|
||||
Log "==> Git pull..." "Cyan"
|
||||
git -c credential.helper="" pull "https://gomag-vending:$token@gitea.romfast.ro/romfast/gomag-vending.git" 2>&1 | Out-Null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Log "EROARE: git pull esuat!" "Red"
|
||||
$pullOutput = & git -c credential.helper="" pull $fetchUrl 2>&1
|
||||
$pullExit = $LASTEXITCODE
|
||||
if ($pullExit -ne 0) {
|
||||
Log "EROARE: git pull esuat (exit=$pullExit): $pullOutput" "Red"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user