-
Notifications
You must be signed in to change notification settings - Fork 131
/
scala-cli.bat
31 lines (22 loc) · 1.06 KB
/
scala-cli.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@echo off
rem This is the launcher script of Scala CLI (https://github.com/VirtusLab/scala-cli).
rem This script downloads and runs the Scala CLI version set by SCALA_CLI_VERSION below.
rem
rem Download the latest version of this script at https://github.com/VirtusLab/scala-cli/raw/main/scala-cli.bat
setlocal enabledelayedexpansion
set "SCALA_CLI_VERSION=1.5.4"
set SCALA_CLI_URL=https://github.com/VirtusLab/scala-cli/releases/download/v%SCALA_CLI_VERSION%/scala-cli.bat
set CACHE_BASE=%localappdata%/Coursier/v1
set CACHE_DEST=%CACHE_BASE%/https/github.com/VirtusLab/scala-cli/releases/download/v%SCALA_CLI_VERSION%
set SCALA_CLI_BIN_PATH=%CACHE_DEST%/scala-cli.bat
if not exist "%SCALA_CLI_BIN_PATH%" (
if not exist "%CACHE_DEST%" mkdir "%CACHE_DEST%"
where /Q curl
if %ERRORLEVEL% EQU 0 (
curl -fLo "%SCALA_CLI_BIN_PATH%" "%SCALA_CLI_URL%"
) else (
echo Could not download scala-cli %SCALA_CLI_VERSION%. Please, install curl and run './scala-cli.bat' again.
exit 1
)
)
%SCALA_CLI_BIN_PATH% %*