detect $init_sbt_version

This commit is contained in:
tksk 2017-04-28 02:28:16 +09:00
parent fb30f81f89
commit ab3de739d7
2 changed files with 10 additions and 0 deletions

View File

@ -170,6 +170,10 @@ process_args () {
}
syncPreloaded() {
if [[ "$init_sbt_version" == "" ]]; then
# FIXME: better $init_sbt_version detection
init_sbt_version="$(ls -1 "$sbt_home/lib/local-preloaded/org.scala-sbt/sbt/")"
fi
[[ -f "$HOME/.sbt/preloaded/org.scala-sbt/sbt/$init_sbt_version/jars/sbt.jar" ]] || {
# lib/local-preloaded exists (This is optional)
[[ -d "$sbt_home/lib/local-preloaded/" ]] && {

View File

@ -143,6 +143,12 @@ if /I "%JAVA_VERSION%" GEQ "9" (
exit /B 0
:sync_preloaded
if "%INIT_SBT_VERSION%"=="" (
rem FIXME: better %INIT_SBT_VERSION% detection
FOR /F "tokens=* USEBACKQ" %%F IN (`dir /b "%SBT_HOME%\..\lib\local-preloaded\org.scala-sbt\sbt" /B`) DO (
SET INIT_SBT_VERSION=%%F
)
)
set PRELOAD_SBT_JAR="%UserProfile%\.sbt\preloaded\org.scala-sbt\sbt\%INIT_SBT_VERSION%\jars\sbt.jar"
if /I "%JAVA_VERSION%" GEQ "1.8" (
where robocopy >nul 2>nul