Tooling: Fix jetpack cli link and unlink #42130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes
pnpm jetpack cli link
andjetpack cli unlink
.Proposed changes:
In #41821 we upgraded
pnpm
to v10 and removed the--global
flag when linking since it wasn't supposed to need it anymore, but apparently this version didn't work as described. Inpnpm
v10.5 this was resolved (though that introduced a separate regression resolved in 10.5.2).For now, we'll just keep the
--global
for the link. Theunlink
never seemed to work, anduninstall
seems to work just as well, so I changed the script to use that.Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
jetpack
isn't in your path/linked/aliased already (e.g.jetpack
should give a "not found" error).pnpm jetpack cli link
.jetpack
runs as expected.jetpack cli unlink
.jetpack
no longer runs. Note that the error might have residual references to annpm
path until you start a new terminal session; fixing that is out of scope and is likely a side effect ofpnpm
in general.