mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-16 04:45:34 +00:00
resource downloader
This commit is contained in:
parent
a618ae471d
commit
1430e979a0
@ -15,7 +15,7 @@ async function downloadGC(branch) {
|
|||||||
const artiUrl = `https://nightly.link/Grasscutters/Grasscutter/workflows/build/${branch}/Grasscutter.zip`
|
const artiUrl = `https://nightly.link/Grasscutters/Grasscutter/workflows/build/${branch}/Grasscutter.zip`
|
||||||
|
|
||||||
// Run installer
|
// Run installer
|
||||||
createCmdWindow(`.\\scripts\\gcdownload.cmd ${artiUrl} ${keystoreUrl} ${branch}`)
|
createCmdWindow(`.\\scripts\\gc_download.cmd ${artiUrl} ${keystoreUrl} ${branch}`)
|
||||||
|
|
||||||
// Set current installation in config
|
// Set current installation in config
|
||||||
config.grasscutterBranch = branch
|
config.grasscutterBranch = branch
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
set KEYSTORE_URL=%1
|
|
||||||
set ARTIFACT_URL=%2
|
|
||||||
set BRANCH=%3
|
|
||||||
set FOLDER_NAME=".\gc-%BRANCH%"
|
|
||||||
set FOLDER_NAME=%FOLDER_NAME:"=%
|
|
||||||
|
|
||||||
title GC Download Script
|
|
||||||
|
|
||||||
if not exist "%FOLDER_NAME%" mkdir "%FOLDER_NAME%"
|
|
||||||
if not exist ".\temp" mkdir ".\temp"
|
|
||||||
|
|
||||||
echo Downloading Grasscutter prebuilt jar...
|
|
||||||
|
|
||||||
:: Download the jar
|
|
||||||
powershell Invoke-WebRequest -Uri %KEYSTORE_URL% -OutFile "./temp/gcjar.zip"
|
|
||||||
|
|
||||||
echo Extracting...
|
|
||||||
|
|
||||||
:: Delete old file if there is one there
|
|
||||||
if exist "%FOLDER_NAME%\grasscutter.jar" del "%FOLDER_NAME%\grasscutter.jar"
|
|
||||||
|
|
||||||
powershell Expand-Archive -Path "./temp/gcjar.zip" -DestinationPath "%FOLDER_NAME%" -Force
|
|
||||||
|
|
||||||
:: Find the jar file name and rename it, just in case
|
|
||||||
for %%i in (%FOLDER_NAME%/*) do (
|
|
||||||
:: If the extension is jar, rename the file
|
|
||||||
if %%~xi equ .jar rename "%FOLDER_NAME%\%%i" grasscutter.jar
|
|
||||||
)
|
|
||||||
|
|
||||||
echo Downloading keystore.p12...
|
|
||||||
|
|
||||||
:: Download the keystore.p12 file
|
|
||||||
powershell Invoke-WebRequest -Uri %ARTIFACT_URL% -OutFile "./%FOLDER_NAME%/keystore.p12"
|
|
||||||
|
|
||||||
:: Remove temp stuff
|
|
||||||
del /s /q "./temp"
|
|
||||||
|
|
||||||
echo Done, latest Grasscutter %BRANCH% now downloaded in %FOLDER_NAME%
|
|
||||||
|
|
||||||
pause
|
|
||||||
|
|
||||||
taskkill /f /fi "WINDOWTITLE eq GC Download Script"
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user