Skip to content

Commit ddcff5a

Browse files
akoclaude
andcommitted
fix: make sync-vsix pick newest .vsix and clean stale ones
sync-vsix now uses ls -t to pick the newest .vsix by mtime instead of alphabetically first, avoiding breakage when multiple .vsix files exist. make clean now removes old .vsix files to prevent stale versions from being embedded. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2da0e2d commit ddcff5a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ sync-lint-rules:
6969
done; \
7070
if [ $$changed -gt 0 ]; then echo "Synced $$changed lint rule file(s)"; fi
7171

72-
# Sync VS Code extension (.vsix) for embedding
72+
# Sync VS Code extension (.vsix) for embedding — picks newest .vsix by mtime
7373
sync-vsix:
74-
@if [ -f vscode-mdl/vscode-mdl-*.vsix ]; then \
75-
src=$$(ls vscode-mdl/vscode-mdl-*.vsix | head -1); \
74+
@src=$$(ls -t vscode-mdl/vscode-mdl-*.vsix 2>/dev/null | head -1); \
75+
if [ -n "$$src" ]; then \
7676
if [ ! -f cmd/mxcli/vscode-mdl.vsix ] || ! cmp -s "$$src" cmd/mxcli/vscode-mdl.vsix; then \
7777
cp "$$src" cmd/mxcli/vscode-mdl.vsix; \
78-
echo "Synced vscode-mdl.vsix"; \
78+
echo "Synced vscode-mdl.vsix ($$src)"; \
7979
fi; \
8080
elif [ ! -f cmd/mxcli/vscode-mdl.vsix ]; then \
8181
echo "Warning: No .vsix found. Creating empty placeholder."; \
@@ -181,6 +181,7 @@ grammar:
181181
# Clean build artifacts
182182
clean:
183183
rm -rf $(BUILD_DIR)
184+
rm -f vscode-mdl/vscode-mdl-*.vsix
184185
go clean
185186

186187
# Build VS Code extension (.vsix) with build-time version info

0 commit comments

Comments
 (0)