Skip to content

Commit

Permalink
Create install.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamRagstad committed Nov 5, 2023
1 parent 7531203 commit 8832615
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions install.ps1
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."

0 comments on commit 8832615

Please sign in to comment.