From 3144e851fcf6aa9cc2ddf9f740509c23d390a3a2 Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Tue, 21 Jan 2025 12:59:00 -0500 Subject: [PATCH] Repeatable install commands (#192) * Use `()` which calls a subshell to run the code, allowing `cd` to not change the callers working directory. * Use `|| true` as the first time ran, there are no files to remove and `zsh` throws an error. * Use `npx @vscode/vsce` to auto install `vsce`. When calling `npx vsce` directly, a warning is displayed to upgrade to `@vscode/vsce`. --- .github/workflows/release-vscode.yml | 4 ++-- docs-old/developer.md | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-vscode.yml b/.github/workflows/release-vscode.yml index ea934acc..fc7da7bd 100644 --- a/.github/workflows/release-vscode.yml +++ b/.github/workflows/release-vscode.yml @@ -68,7 +68,7 @@ jobs: # Build the extension. - name: Package Extension (release) - run: npx vsce package -o "./dist/air-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} + run: npx @vscode/vsce package -o "./dist/air-${{ matrix.code-target }}.vsix" --target ${{ matrix.code-target }} # Upload the extension. - name: Upload artifacts @@ -117,7 +117,7 @@ jobs: # Publish to the Code Marketplace. - name: Publish Extension (Code Marketplace, release) - run: npx vsce publish --pat ${{ secrets.VSCE_PAT }} --packagePath ./dist/air-*.vsix + run: npx @vscode/vsce publish --pat ${{ secrets.VSCE_PAT }} --packagePath ./dist/air-*.vsix # Publish the built extension to OpenVSX publish-openvsx: diff --git a/docs-old/developer.md b/docs-old/developer.md index a561f7e9..3bee9c24 100644 --- a/docs-old/developer.md +++ b/docs-old/developer.md @@ -51,14 +51,11 @@ This installs it to `~/.cargo/bin` (which must be on your `PATH`), and can be re Install the dev version of the VS Code extension: ```sh -# The first time -npm install --global vsce - # Install for Positron -cd editors/code && rm -rf *.vsix && vsce package && positron --install-extension *.vsix +(cd editors/code && (rm -rf *.vsix || true) && npx @vscode/vsce package && positron --install-extension *.vsix) # Install for VS Code -cd editors/code && rm -rf *.vsix && vsce package && code --install-extension *.vsix +(cd editors/code && (rm -rf *.vsix || true) && npx @vscode/vsce package && code --install-extension *.vsix) ``` The CLI tools for Positron or VS Code need to be installed on your path using the command palette command `Shell Command: Install 'code'/'positron' command in PATH`.