Commit 43cbb1d
committed
Escape package name before using in spawn
Preventing shell expansion using single quotes did not work on Windows
as the cmd prompt version of `npm show` would use the quote marks in the
api call.
The closest specification of npm package names comes from the docs where
it says that it must be usable as part of a URL. We don't use
encodeURIComponent() as that would escape @ and / as well, so encodeURI
is enough.
https://docs.npmjs.com/cli/v10/configuring-npm/package-json#name1 parent c483b98 commit 43cbb1d
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| |||
0 commit comments