From 24093316e506ab33f1538c11d7e90e399971b164 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Wed, 24 Apr 2024 14:30:42 -0400 Subject: [PATCH] fix(shorebird_cli): use completion command when compiling shorebird for Windows (#1965) --- bin/shorebird.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/shorebird.ps1 b/bin/shorebird.ps1 index 67688e09..1dc3464e 100644 --- a/bin/shorebird.ps1 +++ b/bin/shorebird.ps1 @@ -137,9 +137,14 @@ function Update-Shorebird { Write-Output "Compiling shorebird..." + # Compile our snapshot + # We invoke `$SNAPSHOT_PATH completion` to trigger the "completion" command, which + # avoids executing as much of our code as possible. We do this because running + # the script here (instead of from the compiled snapshot) invalidates a lot of + # assumptions we make about the cwd in the shorebird_cli tool. & $dart --verbosity=error --disable-dart-dev --snapshot="$snapshotPath" ` --snapshot-kind="app-jit" --packages="$shorebirdCliDir/.dart_tool/package_config.json" ` - --no-enable-mirrors "$shorebirdScript" > $null + --no-enable-mirrors "$shorebirdScript" completion > $null Write-Debug "writing $compileKey to $stampPath" Set-Content -Path $stampPath -Value $compileKey