Skip to content

Commit 707b98d

Browse files
authored
fix: more attemps at npm view json workaround (#1102)
* fix: handle more string permutations * chore: extra trim
1 parent 07225d0 commit 707b98d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/commands/cli/artifacts/compare.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ async function getOwnerAndRepo(plugin: string): Promise<{ owner: string; repo: s
3131
const result = await exec(`npm view ${plugin} repository.url --json`);
3232
try {
3333
const [owner, repo] = (
34-
result.stdout.startsWith('"')
34+
result.stdout.includes('"')
3535
? // it returned json (a string in quotes ex: "git+https://github.com/salesforcecli/plugin-org.git")
36-
(JSON.parse(result.stdout) as string)
36+
(JSON.parse(result.stdout.trim()) as string)
3737
: // it returned non-json (just the string) https://github.com/npm/cli/issues/7537
3838
result.stdout
3939
)

0 commit comments

Comments
 (0)