Skip to content

Commit d45254d

Browse files
fix: pnpm destroy (#95)
* fix: pnpm destroy * feat: bump base library to latest (switch to node-pty) and pnpm fixes
1 parent 3ebf7dc commit d45254d

5 files changed

Lines changed: 130 additions & 21 deletions

File tree

‎package-lock.json‎

Lines changed: 47 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "1.16.3",
3+
"version": "1.16.4",
44
"description": "Default plugin for Codify - provides 50+ declarative resources for managing development tools and system configuration across macOS and Linux",
55
"main": "dist/index.js",
66
"scripts": {
@@ -41,7 +41,7 @@
4141
"license": "ISC",
4242
"type": "module",
4343
"dependencies": {
44-
"@codifycli/plugin-core": "1.2.9",
44+
"@codifycli/plugin-core": "1.2.11",
4545
"@codifycli/schemas": "1.2.0",
4646
"ajv": "^8.18.0",
4747
"ajv-formats": "^2.1.1",

‎rollup.config.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
format: 'cjs',
1212
inlineDynamicImports: true,
1313
},
14-
external: ['@homebridge/node-pty-prebuilt-multiarch'],
14+
external: ['node-pty', '@homebridge/node-pty-prebuilt-multiarch'],
1515
plugins: [
1616
json(),
1717
nodeResolve({ exportConditions: ['node'] }),

‎src/resources/javascript/pnpm/pnpm.ts‎

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,16 @@ export class Pnpm extends Resource<PnpmConfig> {
8686
await fs.rm(pnpmHome?.trim() || expectedPnpmHome, { recursive: true, force: true });
8787

8888
const shellRc = Utils.getPrimaryShellRc();
89+
90+
// `pnpm setup` owns this block and its formatting drifts between versions and platforms:
91+
// PNPM_HOME has been emitted with both double and single quotes, the PATH guard targets
92+
// either $PNPM_HOME or $PNPM_HOME/bin, and on Linux the trailing `# pnpm end` marker is not
93+
// always written. Remove the marked range first, then clean up structurally so a block with
94+
// no end marker does not survive.
95+
await FileUtils.removeBlockFromFile(shellRc, '# pnpm', '# pnpm end')
96+
await FileUtils.removeCaseStatementReferencing(shellRc, '$PNPM_HOME')
97+
await FileUtils.removeLineFromStartupFile(/^export PNPM_HOME=.*$/)
8998
await FileUtils.removeLineFromStartupFile('# pnpm')
90-
await FileUtils.removeLineFromStartupFile(`export PNPM_HOME="${expectedPnpmHome}"`)
91-
await FileUtils.removeFromFile(shellRc,
92-
`case ":$PATH:" in
93-
*":$PNPM_HOME/bin:"*) ;;
94-
*) export PATH="$PNPM_HOME/bin:$PATH" ;;
95-
esac`)
96-
await FileUtils.removeFromFile(shellRc,
97-
`case ":$PATH:" in
98-
*":$PNPM_HOME:"*) ;;
99-
*) export PATH="$PNPM_HOME:$PATH" ;;
100-
esac`)
10199
await FileUtils.removeLineFromStartupFile('# pnpm end')
102100
} else if (isInstalledByNpm) {
103101
await $.spawn('npm uninstall -g pnpm', { interactive: true });

0 commit comments

Comments
 (0)