From 5491f62e414d3cb46306c30cadedead071268064 Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Fri, 12 Jan 2024 22:01:00 -0600 Subject: [PATCH] Windows setup runs 'lando setup' command --- setup-lando.ps1 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup-lando.ps1 b/setup-lando.ps1 index 0b38086..ff0d0b0 100755 --- a/setup-lando.ps1 +++ b/setup-lando.ps1 @@ -397,6 +397,24 @@ function Install-LandoInWSL { } } +# Runs the "lando setup" command if Lando is at least version 3.21.0 +function Invoke-LandoSetup { + Write-Debug "Running 'lando setup'..." + if ($version -lt "v3.21.0") { + Write-Debug "Skipping 'lando setup' because version $version is less than 3.21.0." + return + } + $landoSetupCommand = "$dest\lando.exe setup" + Write-Debug "Running '$landoSetupCommand'" + try { + Invoke-Expression $landoSetupCommand + } catch { + Write-Host $_.Exception.Message + Write-Host "Failed to run 'lando setup'. You may need to manually run this command to complete the setup." -ForegroundColor Red + Write-Debug $_.Exception + } +} + Write-Debug "Running script with:" Write-Debug " -arch: $arch" Write-Debug " -debug: $debug"