Skip to content

Commit

Permalink
Apply suggestions from code reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
lwronski committed Oct 12, 2021
1 parent 453930e commit e8b4b23
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions scala-cli.bat
Original file line number Diff line number Diff line change
@@ -1,30 +1,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 VERSION below.
rem
rem Download the latest version of this script at https://github.com/VirtusLab/scala-cli/raw/master/scala-cli.bat

setlocal enabledelayedexpansion

set "SCALA_CLI_VERSION=0.0.5"
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% %*
@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 VERSION below.
rem
rem Download the latest version of this script at https://github.com/VirtusLab/scala-cli/raw/master/scala-cli.bat

setlocal enabledelayedexpansion

set "SCALA_CLI_VERSION=0.0.5"

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% %*

0 comments on commit e8b4b23

Please sign in to comment.