Skip to content

Commit

Permalink
Fix uninstaller + bundling of the vsix
Browse files Browse the repository at this point in the history
Signed-off-by: paulober <[email protected]>
  • Loading branch information
paulober committed Sep 10, 2024
1 parent 56d5cb7 commit d6bd6ff
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 13 deletions.
24 changes: 21 additions & 3 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,35 @@ out/**
.yarnrc
.yarnrc.yml
.npmrc
rollup.config.mjs
*rollup.config.mjs
**/tsconfig.json
**/.eslintrc.json
**/*.map
**/eslint.config.mjs
**/*.ts
.pnp*
*.vsix
*.zip
*.tgz
*.tar.gz
*.tar
*.gz
*.rar
*.7z
*.exe
tmp.py

# make sure scripts and data are always included
!scripts/**
!scripts/blink.pio
!scripts/lwipopts.h
!scripts/pico_configs.tsv
!scripts/pico_project.py
!scripts/pico-vscode.cmake
!scripts/Pico.code-profile
!scripts/raspberrypi-swd.cfg
!data/**
scripts/*.ps1
scripts/fix_windows_reg.py
scripts/vscodeUninstaller.mjs
scripts/genCache.py
scripts/genExamples.py
scripts/build.mjs
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ For comprehensive setup instructions, refer to the [Getting Started guide](https
- One-Click Compilation: Compile projects directly from the status bar with your selected SDK and tools.
- Offline Documentation: Access Pico SDK documentation offline.
- Quick Project Setup: Quickly create new Pico projects from the Explorer view when no workspace is open.
- Includes an Uninstaller: Easily remove the extension along with all automatically installed tools and SDKs.

## Requirements by OS

Expand Down
3 changes: 2 additions & 1 deletion rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import commonjs from '@rollup/plugin-commonjs';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';

//const isProduction = process.env.BUILD === 'production';
const isProduction = process.env.BUILD === 'production';

export default {
input: 'src/extension.mts',
output: {
//dir: 'dist',
file: 'dist/extension.cjs',
format: 'cjs',
// isProduction ? "hidden" : true
sourcemap: true,
exports: 'named',
},
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { execSync } from 'child_process';
const buildEnv = process.env.BUILD_ENV || 'production';
const sourcemap = buildEnv === 'production' ? 'hidden' : 'true';

console.debug("Building with:\nenvironment =", buildEnv, "\nsourcemap =", sourcemap);
console.debug("Building with:\nenvironment =", buildEnv, "\nsourcemap =", sourcemap, "(out of order, always true)");

const command = `rollup -c --environment BUILD:${buildEnv} --sourcemap ${sourcemap}`;
const command = `rollup -c --environment BUILD:${buildEnv}`;
execSync(command, { stdio: 'inherit' });
12 changes: 5 additions & 7 deletions scripts/vscodeUninstaller.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import { rimraf } from "rimraf";

const picoSdkRoot = join(homedir(), ".pico-sdk");

rimraf(picoSdkRoot, (err) => {
if (err) {
console.error(err);
} else {
console.log(`Successfully uninstalled Pico SDK and it's dependencies from ${picoSdkRoot}.`);
}
}, { glob: false });
rimraf(picoSdkRoot, { glob: false }).then(() => {
console.log("Pico SDK has been uninstalled successfully.");
}).catch((err) => {
console.error("Error occurred while uninstalling Pico SDK:", err);
});

0 comments on commit d6bd6ff

Please sign in to comment.