Fix error
This commit is contained in:
+1
-20
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user