Fix error

This commit is contained in:
2026-11-14 22:20:51 +07:00
parent 1a4774e376
commit 8ea1d6ac52
2 changed files with 21 additions and 39 deletions
+1 -20
View File
@@ -24,26 +24,7 @@ echo ===========================================================================
echo Repository : %GITEA_URL%/%REPO_OWNER%/%REPO_NAME%
echo.
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"$ErrorActionPreference = 'Stop';" ^
"$base = '%GITEA_URL%'.TrimEnd('/'); $owner = '\%REPO_OWNER\%';$repo = '%REPO_NAME%';" ^
"$apiUrl = \"$base/api/v1/repos/$owner/$repo/releases/latest\";" ^
"$cred =$null;" ^
"try {" ^
" $rel = Invoke-RestMethod -Uri$apiUrl -UseBasicParsing;" ^
"} catch {" ^
" Write-Host '[AUTH] Private repository detected. Please sign in to Gitea:' -ForegroundColor Yellow;" ^
" $cred = Get-Credential -Message 'Enter Gitea Credentials';" ^
" $rel = Invoke-RestMethod -Uri $apiUrl -Credential$cred -UseBasicParsing;" ^
"}" ^
"$tag =$rel.tag_name;" ^
"$rawUrl = \"$base/$owner/$repo/raw/tag/$tag/scripts/bootstrap.ps1\";" ^
"if ($null -ne$cred) {" ^
" $script = Invoke-RestMethod -Uri $rawUrl -Credential$cred -UseBasicParsing;" ^
"} else {" ^
" $script = Invoke-RestMethod -Uri$rawUrl -UseBasicParsing;" ^
"}" ^
"& ([scriptblock]::Create($script)) -GiteaUrl$base -Owner $owner -Repo$repo -ReleaseJson $rel -Credential$cred"
powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $base='%GITEA_URL%'.TrimEnd('/'); $owner='%REPO_OWNER%'; $repo='%REPO_NAME%'; $apiUrl=\"$base/api/v1/repos/$owner/$repo/releases/latest\"; $cred=$null; try { $rel=Invoke-RestMethod -Uri $apiUrl -UseBasicParsing } catch { Write-Host '[AUTH] Private repository detected. Please sign in to Gitea:' -ForegroundColor Yellow; $cred=Get-Credential -Message 'Enter Gitea Credentials'; $rel=Invoke-RestMethod -Uri $apiUrl -Credential $cred -UseBasicParsing }; $tag=$rel.tag_name; $rawUrl=\"$base/$owner/$repo/raw/tag/$tag/scripts/bootstrap.ps1\"; if ($null -ne $cred) { $script=Invoke-RestMethod -Uri $rawUrl -Credential $cred -UseBasicParsing } else { $script=Invoke-RestMethod -Uri $rawUrl -UseBasicParsing }; & ([scriptblock]::Create($script)) -GiteaUrl $base -Owner $owner -Repo $repo -ReleaseJson $rel -Credential $cred"
if %errorLevel% neq 0 (
echo.