Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

fix: `rm` old vscode versions after `just test-vscode` (#2574)

Andrew Dunbard4390e572b44
diff --git a/justfile b/justfile
index 0b08b7b78..982a558a3 100644
--- a/justfile
+++ b/justfile
@@ -205,6 +205,20 @@ test-vscode:
pnpm test
fi
+ # Over time, VSCode test versions take up space that can be hard to track down
+ if [[ -d .vscode-test ]]; then
+ all_versions=$(ls -1 .vscode-test | grep "^vscode-" | sort -V)
+ latest_version=$(echo "$all_versions" | tail -n 1)
+ old_versions=$(echo "$all_versions" | sed '$d') # Delete last line instead
+ if [[ -n "$old_versions" ]]; then
+ count=$(echo "$old_versions" | wc -l)
+ echo "$old_versions" | xargs -I {} rm -rf .vscode-test/{}
+ echo "✓ Deleted $count old VSCode versions, keeping $latest_version"
+ else
+ echo "✓ No old versions to clean (keeping $latest_version)"
+ fi
+ fi
+
# Build and package the Visual Studio Code extension.
# If `target` is passed, it is assumed that `harper-ls` has been compiled beforehand and is in `packages/vscode-plugin/bin`. This is used in CI.
package-vscode target="":