mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:56:29 +00:00
33 lines
1021 B
Batchfile
33 lines
1021 B
Batchfile
setlocal enabledelayedexpansion
|
|
|
|
set LOGIN_URL=https://api.azaion.com/login
|
|
set RESOURCE_URL=https://api.azaion.com/resources
|
|
set EMAIL=uploader@azaion.com
|
|
set PASSWORD=Az@1on_10Upl0@der
|
|
set FILE_TO_UPLOAD=bin\Release\net8.0-windows\secure\Azaion.Annotator.dll
|
|
|
|
echo Logging in and retrieving token...
|
|
for /f "tokens=*" %%i in ('curl -s -X POST -H "Content-Type: application/json" ^
|
|
-d "{\"email\":\"%EMAIL%\",\"password\":\"%PASSWORD%\"}" %LOGIN_URL%') do set RESPONSE=%%i
|
|
|
|
for /f "tokens=2 delims=:" %%a in ('echo %RESPONSE% ^| findstr /i "token"') do (
|
|
set "TOKEN=%%a"
|
|
set "TOKEN=!TOKEN:~1,-1!"
|
|
set "TOKEN=!TOKEN:~0,-2!"
|
|
)
|
|
|
|
echo Token retrieved: %TOKEN%
|
|
|
|
:: Step 2: Upload the DLL file
|
|
if not exist "%FILE_TO_UPLOAD%" (
|
|
echo File %FILE_TO_UPLOAD% does not exist. Exiting...
|
|
exit /b 1
|
|
)
|
|
|
|
echo Uploading file to resources...
|
|
curl -X POST -H "Authorization: Bearer %TOKEN%" ^
|
|
-H "Content-Type: application/octet-stream" ^
|
|
--data-binary @"%FILE_TO_UPLOAD%" ^
|
|
%RESOURCE_URL%
|
|
|
|
echo Done! |