Skip to content

Commit

Permalink
Update wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz committed Jun 28, 2024
1 parent 37bede9 commit b9734bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 6 additions & 3 deletions korge
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ if [ ! -f "$JAVA" ]; then
mkdir -p "$HOME/.korge"
mkdir "$HOME/.korge/jdk-21" 2> /dev/null
if [[ "${OSTYPE}" == 'darwin'* ]]; then
download_file "https://github.com/korlibs/universal-jre/releases/download/0.0.1/macos-universal-jdk-21+35-jre.tar.xz" "$HOME/.korge/jdk-21.tar.xz" "d7b2ab87de30584ee60b788dfbd8ea3fadf3b0ee06aeef37ac99e07de6d6281c"
tar --strip-components 3 -xf "$HOME/.korge/jdk-21.tar.xz" -C "$HOME/.korge/jdk-21"
download_file "https://github.com/korlibs/universal-jre/releases/download/0.0.1/microsoft-jre-21.0.3-mac-universal.tar.xz" "$HOME/.korge/jdk-21.tar.xz" "430909fef93915338979e49363474f55b04e3e4de03db225d5d2577467d603bc"
tar --strip-components 1 -xf "$HOME/.korge/jdk-21.tar.xz" -C "$HOME/.korge/jdk-21"
else
export ARCH=$(uname -m)
if [ "${ARCH}" == "aarch64" ] || [ "${ARCH}" == "arm64"* ]; then
Expand All @@ -54,15 +54,18 @@ if [ ! -f "$JAVA" ]; then
fi
tar --strip-components 1 -xf "$HOME/.korge/jdk-21.tar.xz" -C "$HOME/.korge/jdk-21"
fi
rm "$HOME/.korge/jdk-21.tar.xz"
fi

if [ ! -f "$HOME/.korge/compiler/korge-kotlin-compiler-all.$INSTALLER_VERSION.jar" ]; then
mkdir -p "$HOME/.korge/compiler" 2> /dev/null

download_file "$INSTALLER_URL" "$HOME/.korge/compiler/korge-kotlin-compiler-all.$INSTALLER_VERSION.tar.xz" "$INSTALLER_SHA256"

tar -xf "$HOME/.korge/compiler/korge-kotlin-compiler-all.$INSTALLER_VERSION.tar.xz" -C "$HOME/.korge/compiler"
INSTALLER_TAR_XZ_PATH=$HOME/.korge/compiler/korge-kotlin-compiler-all.$INSTALLER_VERSION.tar.xz
tar -xf "$INSTALLER_TAR_XZ_PATH" -C "$HOME/.korge/compiler"
cp "$HOME/.korge/compiler"/korge-kotlin-compiler-all.jar "$HOME/.korge/compiler/korge-kotlin-compiler-all.$INSTALLER_VERSION.jar"
rm "$INSTALLER_TAR_XZ_PATH"
fi

"$JAVA" -jar "$HOME/.korge/compiler/korge-kotlin-compiler-all.$INSTALLER_VERSION.jar" $*
5 changes: 2 additions & 3 deletions korge.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ IF NOT EXIST "%INSTALLER_LOCAL_FILE%" (
CALL :DOWNLOAD_FILE "%INSTALLER_URL%" "%INSTALLER_LOCAL_FILE%.tar.xz" "%INSTALLER_SHA256%"
CALL :EXTRACT_TAR "%INSTALLER_LOCAL_FILE%.tar.xz" "%INSTALLER_PATH%" 0 "%INSTALLER_LOCAL_FILE%"
COPY /Y "%INSTALLER_PATH%\korge-kotlin-compiler-all.jar" %INSTALLER_LOCAL_FILE% > NUL 2> NUL
DEL "%INSTALLER_LOCAL_FILE%.tar.xz" > NUL 2> NUL
)

IF NOT EXIST "%JAVA%" (
Expand All @@ -25,11 +26,9 @@ IF NOT EXIST "%JAVA%" (
CALL :DOWNLOAD_FILE "https://github.com/korlibs/universal-jre/releases/download/0.0.1/microsoft-jre-21.0.3-windows-x64.tar.xz" "%KORGEDIR%\jre-21.tar.xz" "6D16528A2201DCBE0ADDB0622F5CBE0CD6FA84AE937D3830FC1F74B32132C37B"
)
CALL :EXTRACT_TAR "%KORGEDIR%\jre-21.tar.xz" "%KORGEDIR%\jre-21" 1 "%JAVA%"
DEL "%KORGEDIR%\jre-21.tar.xz" > NUL 2> NUL
)

REM CALL :NORMALIZE_PATH "."
REM echo %RETVAL%
REM "%JAVA%" "-Duser.dir=%RETVAL%" -jar "%INSTALLER_LOCAL_FILE%" %*
"%JAVA%" -jar "%INSTALLER_LOCAL_FILE%" %*

EXIT /B
Expand Down

0 comments on commit b9734bd

Please sign in to comment.