From 284f55425b869bb70196b8690ee5155be5296861 Mon Sep 17 00:00:00 2001 From: merceyz Date: Sun, 1 Aug 2021 11:40:07 +0200 Subject: [PATCH] fix: avoid using eval to get the corepack version --- sources/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sources/main.ts b/sources/main.ts index 51c589d7d..114609ae2 100644 --- a/sources/main.ts +++ b/sources/main.ts @@ -85,8 +85,10 @@ export async function main(argv: Array, context: CustomContext & Partial ...context, }); } else { - const binaryVersion = eval(`require`)(`corepack/package.json`).version; - const cli = new Cli({binaryName: `corepack`, binaryVersion}); + const cli = new Cli({ + binaryName: `corepack`, + binaryVersion: require(`../package.json`).version, + }); cli.register(Builtins.HelpCommand); cli.register(Builtins.VersionCommand);