@@ -100,17 +100,35 @@ RUN npm install --global @vscode/vsce yarn && \
100100 rm --force --recursive design50.vsix && \
101101 npm uninstall --global vsce yarn
102102
103- # Pull Python VS Code extension and remove run button from editor title menu
103+
104+ # Build custom versions of Microsoft's Python extensions to remove the "Run Button"
104105RUN cd /tmp && \
105- git clone --branch v2025.14.0 --depth 1 https://github.com/microsoft/vscode-python.git && \
106- cd vscode-python && \
107- # Remove the editor/title/run entry and save back to package.json
108- jq 'del(.contributes.menus."editor/title/run")' package.json > package.tmp.json && mv package.tmp.json package.json && \
109- npm install && \
110- npm run package && \
111- mv ms-python-insiders.vsix /opt/cs50/extensions && \
112- cd /tmp && \
113- rm --force --recursive vscode-python
106+ # Process each extension: format is "repo-name|build-command|output-filename"
107+ for ext in \
108+ "vscode-python|package|ms-python-insiders.vsix" \
109+ "vscode-python-debugger|vsce-package|python-debugger.vsix" \
110+ "vscode-python-environments|vsce-package|ms-python-envs-insiders.vsix" ; \
111+ do \
112+ # Parse the pipe-delimited string
113+ repo=$(echo "$ext" | cut -d'|' -f1) && \
114+ build_cmd=$(echo "$ext" | cut -d'|' -f2) && \
115+ output_file=$(echo "$ext" | cut -d'|' -f3) && \
116+ # Fetch the latest release tag from GitHub API
117+ echo "Fetching latest release for $repo..." && \
118+ latest_tag=$(curl -s "https://api.github.com/repos/microsoft/$repo/releases/latest" | jq -r .tag_name) && \
119+ echo "Using version: $latest_tag" && \
120+ # Clone the repository at the latest release tag
121+ git clone --branch "$latest_tag" --depth 1 "https://github.com/microsoft/$repo.git" && \
122+ cd "$repo" && \
123+ # Modify package.json to remove the editor/title/run contributions if it exists
124+ jq 'del(.contributes.menus."editor/title/run")' package.json > package.tmp.json && \
125+ mv package.tmp.json package.json && \
126+ npm install && \
127+ npm run "$build_cmd" && \
128+ mv "$output_file" /opt/cs50/extensions && \
129+ cd /tmp && \
130+ rm --force --recursive "$repo" ; \
131+ done
114132
115133# Final stage
116134FROM cs50/cli:${TAG}
0 commit comments