Skip to content

Commit bddfa10

Browse files
authored
Tooling: Fix jetpack cli link and unlink (#42130)
* Fix cli link/unlink * Add comments
1 parent 48dfb55 commit bddfa10

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/cli/commands/cli.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ function cliLink( options ) {
4747
[
4848
{
4949
title: chalkJetpackGreen( `Enabling global access to the CLI` ),
50-
task: () => command( 'pnpm link', options.v, path.resolve( 'tools/cli' ) ),
50+
// Theoretically we shouldn't need the --global as of v10.0, but there was a bug until 10.5.
51+
// It shouldn't hurt to leave this.
52+
task: () => command( 'pnpm link --global', options.v, path.resolve( 'tools/cli' ) ),
5153
},
5254
],
5355
opts
@@ -87,7 +89,9 @@ function cliUnlink( options ) {
8789
[
8890
{
8991
title: chalkJetpackGreen( `Removing global access to the CLI` ),
90-
task: () => command( 'pnpm unlink', options.v, path.resolve( 'tools/cli' ) ),
92+
// In theory unlink should work, but it doesn't (and there are dozens of issues related
93+
// to link/unlink in the pnpm repo. This works well.
94+
task: () => command( 'pnpm uninstall --global jetpack-cli', options.v ),
9195
},
9296
],
9397
opts

0 commit comments

Comments
 (0)