Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions get-lit.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

$LUVI_VERSION = "2.14.0"
$LIT_VERSION = "3.8.5"
$LUVI_VERSION = "2.15.0"
$LIT_VERSION = "3.9.0"
# Environment variables take precedence
if (test-path env:LUVI_VERSION) { $LUVI_VERSION = $env:LUVI_VERSION }
if (test-path env:LIT_VERSION) { $LIT_VERSION = $env:LIT_VERSION }
Expand All @@ -14,7 +16,17 @@ if (test-path env:LUVI_ARCH) {
$LUVI_ARCH = "Windows-ia32"
}
}
$LUVI_URL = "https://github.com/luvit/luvi/releases/download/v$LUVI_VERSION/luvi-regular-$LUVI_ARCH.exe"
if ([version]"2.15.0" -le [version]$LUVI_VERSION) {
if ($LUVI_ARCH -eq "Windows-i386") {
$LUVI_ARCH = "Windows-x86"
}
$LUVI_URL = "https://github.com/luvit/luvi/releases/download/v$LUVI_VERSION/luvi-$LUVI_ARCH-luajit-regular.exe"
} else {
if ($LUVI_ARCH -eq "Windows-x86") {
$LUVI_ARCH = "Windows-ia32"
}
$LUVI_URL = "https://github.com/luvit/luvi/releases/download/v$LUVI_VERSION/luvi-regular-$LUVI_ARCH.exe"
}
$LIT_URL = "https://lit.luvit.io/packages/luvit/lit/v$LIT_VERSION.zip"

function Download-File {
Expand Down
16 changes: 12 additions & 4 deletions get-lit.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#!/bin/sh
set -eu
LUVI_VERSION=${LUVI_VERSION:-2.14.0}
LIT_VERSION=${LIT_VERSION:-3.8.5}
LUVI_VERSION=${LUVI_VERSION:-2.15.0}
LIT_VERSION=${LIT_VERSION:-3.9.0}

LUVI_OS=$(uname -s)
LUVI_ARCH=$(uname -m)

# 2.15.0 or higher uses a different URL
if [ "2.15.0" = "$(printf '%s\n%s\n' "2.15.0" "$LUVI_VERSION" | sort -V | head -n 1)" ]; then
LUVI_URL="https://github.com/luvit/luvi/releases/download/v$LUVI_VERSION/luvi-${LUVI_OS}-${LUVI_ARCH}-luajit-regular"
else
LUVI_URL="https://github.com/luvit/luvi/releases/download/v$LUVI_VERSION/luvi-regular-${LUVI_OS}_$LUVI_ARCH"
fi

LUVI_ARCH=`uname -s`_`uname -m`
LUVI_URL="https://github.com/luvit/luvi/releases/download/v$LUVI_VERSION/luvi-regular-$LUVI_ARCH"
LIT_URL="https://lit.luvit.io/packages/luvit/lit/v$LIT_VERSION.zip"

# Download Files
Expand Down