-
Notifications
You must be signed in to change notification settings - Fork 58
/
get-lit.ps1
41 lines (36 loc) · 1.39 KB
/
get-lit.ps1
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
32
33
34
35
36
37
38
39
40
41
$LUVI_VERSION = "2.14.0"
$LIT_VERSION = "3.8.5"
# 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 }
if (test-path env:LUVI_ARCH) {
$LUVI_ARCH = $env:LUVI_ARCH
} else {
if ([System.Environment]::Is64BitProcess) {
$LUVI_ARCH = "Windows-amd64"
} else {
$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 {
param (
[string]$url,
[string]$file
)
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls11 -bor [System.Net.SecurityProtocolType]::Tls12;
Write-Host "Downloading $url to $file"
$downloader = new-object System.Net.WebClient
$downloader.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials;
$downloader.DownloadFile($url, $file)
}
# Download Files
Download-File $LUVI_URL "luvi.exe"
Download-File $LIT_URL "lit.zip"
# Create lit.exe using lit
Start-Process ".\luvi.exe" -ArgumentList "lit.zip -- make lit.zip lit.exe luvi.exe" -Wait -NoNewWindow
# Cleanup
Remove-Item "lit.zip"
# Create luvit using lit
Start-Process ".\lit.exe" -ArgumentList "make lit://luvit/luvit luvit.exe luvi.exe" -Wait -NoNewWindow