-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-lit-latest.ps1
More file actions
36 lines (31 loc) · 1.16 KB
/
get-lit-latest.ps1
File metadata and controls
36 lines (31 loc) · 1.16 KB
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
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/latest/download/luvi-regular-$LUVI_ARCH.exe"
$LIT_URL = "https://github.com/wbx/lit/releases/latest/download/lit.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 github://luvit/luvit luvit.exe luvi.exe" -Wait -NoNewWindow