Skip to content

Commit 0846a44

Browse files
committed
fix: fix yarn view method to return correct data
As --json flag is hardcoded for `yarn info` command, it always returns a json object in following format: { data: someResult }. As the other methods expect only `someResult` as a result from view command, we need to return `.data` property from `yarn info` output.
1 parent 990f54f commit 0846a44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/yarn-package-manager.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export class YarnPackageManager extends BasePackageManager {
6464
} catch (e) {
6565
this.$errors.failWithoutHelp(e.message);
6666
}
67-
return JSON.parse(viewResult);
67+
68+
const result = JSON.parse(viewResult);
69+
return result.data;
6870
}
6971

7072
@exported("yarn")

0 commit comments

Comments
 (0)