Skip to content

Commit 78d94eb

Browse files
authored
fix: avoid using eval to get the corepack version (#45)
1 parent 8dad5af commit 78d94eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sources/main.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,10 @@ export async function main(argv: Array<string>, context: CustomContext & Partial
8585
...context,
8686
});
8787
} else {
88-
const binaryVersion = eval(`require`)(`corepack/package.json`).version;
89-
const cli = new Cli<Context>({binaryName: `corepack`, binaryVersion});
88+
const cli = new Cli<Context>({
89+
binaryName: `corepack`,
90+
binaryVersion: require(`../package.json`).version,
91+
});
9092

9193
cli.register(Builtins.HelpCommand);
9294
cli.register(Builtins.VersionCommand);

0 commit comments

Comments
 (0)