-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7531203
commit 8832615
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Windows installer for the Lento toolchain | ||
|
||
$FILE_URL = "https://api.github.com/repos/lento-lang/lento/releases/latest" | ||
FILE_NAME="lento-win.zip" | ||
|
||
write-host "Installing Lento toolchain..." -ForegroundColor Yellow | ||
|
||
# Download the latest release | ||
$latest = Invoke-RestMethod -Uri $FILE_URL | ||
$downloadUrl = $latest.assets | ? { $_.name -eq $FILE_NAME } | % { $_.browser_download_url } | ||
Invoke-WebRequest -Uri $downloadUrl -OutFile $FILE_NAME | ||
|
||
# Create the installation directory | ||
$installDir = "$env:USERPROFILE/lento" | ||
New-Item -ItemType Directory -Force -Path $installDir | ||
Move-Item -Path $FILE_NAME -Destination $installDir | ||
Expand-Archive -Path "$installDir/$FILE_NAME" -DestinationPath $installDir | ||
Remove-Item -Path "$installDir/$FILE_NAME" | ||
|
||
# Add the installation directory to the PATH | ||
$env:Path += ";$installDir" | ||
|
||
write-host "Installation complete!" -ForegroundColor Green | ||
write-host "Run 'lt' to get started." |