Files
spark/tools/add_github_nuget_source.cmd
2026-01-04 21:19:00 +00:00

24 lines
569 B
Batchfile

@echo off
@setlocal
if "%2"=="" (
set api_key=%GITHUB_PERSONAL_ACCESS_TOKEN%
) else (
set api_key=%2
)
if "%api_key%"=="" (
echo Personal acces token is empty. Define GITHUB_PERSONAL_ACCESS_TOKEN env var
exit /b 1
)
set source_url="https://nuget.pkg.github.com/blue-trading-solutions/index.json"
set user=%GITHUB_USER%
if "%user%"=="" (
echo User is empty. Define GITHUB_USER env var
exit /b 1
)
set root_dir="%~dp0.."
cd %root_dir%
dotnet nuget add source %source_url% --username %user% --password %api_key% --store-password-in-clear-text --name github