From 0846a4499ba496f94b303d4a03b748e608e35686 Mon Sep 17 00:00:00 2001 From: fatme Date: Tue, 20 Nov 2018 08:31:55 +0200 Subject: [PATCH] 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. --- lib/yarn-package-manager.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/yarn-package-manager.ts b/lib/yarn-package-manager.ts index 661ab57e91..a1f0e4e7ba 100644 --- a/lib/yarn-package-manager.ts +++ b/lib/yarn-package-manager.ts @@ -64,7 +64,9 @@ export class YarnPackageManager extends BasePackageManager { } catch (e) { this.$errors.failWithoutHelp(e.message); } - return JSON.parse(viewResult); + + const result = JSON.parse(viewResult); + return result.data; } @exported("yarn")