# Graphlit: the terminal client on Windows. # # irm https://graphlit.co/install.ps1 | iex # # Read it first if you like. This URL serves plain text: # # irm https://graphlit.co/install.ps1 # # THERE IS NO NATIVE WINDOWS BUILD YET. The client is a single compiled binary # and it is published for Linux and macOS only. Rather than install something # that cannot work, this script points you at WSL - which is a real Linux # machine, runs the ordinary installer unmodified, and is where your project # almost certainly already lives if you are using one. # # If you want to be told when a native build lands: https://graphlit.co/contact $ErrorActionPreference = 'Stop' # Windows PowerShell 5.1 negotiates SSLv3/TLS1.0 by default and simply fails # against any host that has turned those off - which is all of them. Kept even # though this script no longer downloads anything, because the WSL command it # prints does, and because the next version of this file will. try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch { } $Api = if ($env:GRAPHLIT_API) { $env:GRAPHLIT_API } else { 'https://graphlit.co' } $Unix = "curl -fsSL https://graphlit.co/install.sh | sh" function Step($m) { Write-Host "==> " -ForegroundColor Green -NoNewline; Write-Host $m -ForegroundColor White } function Note($m) { Write-Host " $m" -ForegroundColor DarkGray } Write-Host "" Write-Host " Graphlit" -ForegroundColor White -NoNewline Write-Host ": the terminal client on Windows" Write-Host "" Step 'There is no native Windows build yet' Note 'The client ships as one compiled binary, built for Linux and macOS.' Note 'Nothing has been installed on this machine.' Write-Host "" # `Get-Command wsl` is the check, not `wsl --status`: on a machine where WSL has # never been enabled the `wsl.exe` stub still exists but every subcommand exits # non-zero with a help screen, so testing the command tells you it is *there* # and testing a subcommand tells you it *works*. We only need the first, because # the instruction is the same either way and Microsoft's own installer is one # line below it. if (Get-Command wsl -ErrorAction SilentlyContinue) { Step 'You already have WSL. Run this inside it' Write-Host "" Write-Host " wsl -e sh -c '$Unix'" -ForegroundColor White Write-Host "" Note 'Or open your Linux shell and paste the installer there.' } else { Step 'Install WSL first, then the client inside it' Write-Host "" Write-Host " wsl --install" -ForegroundColor White Write-Host " # reboot, open Ubuntu, then:" Write-Host " $Unix" -ForegroundColor White Write-Host "" Note 'wsl --install needs an administrator PowerShell. Nothing else here does.' } Write-Host "" Note "The client will talk to $Api" Note "Questions, or want the native build: https://graphlit.co/contact" Write-Host ""