github.com/tilt-dev/tilt@v0.33.15-0.20240515162809-0a22ed45d8a0/scripts/install.ps1 (about) 1 # Tilt installer 2 # 3 # Usage: 4 # iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.ps1') 5 6 $version = "0.33.14" 7 $url = "https://github.com/tilt-dev/tilt/releases/download/v" + $version + "/tilt." + $version + ".windows.x86_64.zip" 8 $zip = "tilt-" + $version + ".zip" 9 $extractDir = "tilt-" + $version 10 $binDir = "$HOME\bin" 11 $dest = "$binDir\tilt.exe" 12 13 $useScoop = "" 14 if (Get-Command "scoop" 2>$null) { 15 $useScoop = "true" 16 } 17 18 if ("true" -eq $useScoop) { 19 Write-Host "Scoop detected! (https://scoop.sh)" 20 scoop bucket add tilt-dev https://github.com/tilt-dev/scoop-bucket 21 scoop install tilt 22 scoop update tilt 23 tilt version 24 tilt verify-install 25 Write-Output "Tilt installed with Scoop! Run 'tilt up' to start." 26 return 27 } 28 29 Write-Output "Downloading $url" 30 if (Test-Path "$zip") { 31 Remove-Item -Force "$zip" 32 } 33 Invoke-WebRequest $url -OutFile $zip 34 35 Write-Output "Extracting $zip" 36 if (Test-Path "$extractDir") { 37 Remove-Item -Force -Recurse "$extractDir" 38 } 39 Expand-Archive $zip -DestinationPath $extractDir 40 41 Write-Output "Installing Tilt as $dest" 42 New-Item -ItemType Directory -Force -Path $binDir >$null 43 Move-Item -Force -Path "$extractDir\tilt.exe" -Destination "$dest" 44 45 Remove-Item -Force -Path "$zip" 46 Remove-Item -Force -Recurse -Path "$extractDir" 47 48 iex "$dest version" 49 iex "$dest verify-install" 50 51 Write-Output "Tilt installed!" 52 Write-Output "Run '$dest up' to start." 53 Write-Output "Or add $binDir to your PATH" 54