From 55bf77a1286733ce39e76a2aa6b66071a3b9008e Mon Sep 17 00:00:00 2001 From: Ronan Sandford Date: Wed, 3 May 2023 23:29:00 +0100 Subject: [PATCH] ability to specify install dir (#29) Co-authored-by: Avery Harnish --- packages/binary-install/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/binary-install/index.js b/packages/binary-install/index.js index fda5206..1555170 100644 --- a/packages/binary-install/index.js +++ b/packages/binary-install/index.js @@ -12,7 +12,7 @@ const error = msg => { }; class Binary { - constructor(name, url) { + constructor(name, url, config) { let errors = []; if (typeof url !== "string") { errors.push("url must be a string"); @@ -42,7 +42,7 @@ class Binary { } this.url = url; this.name = name; - this.installDirectory = join(__dirname, "node_modules", ".bin"); + this.installDirectory = config?.installDirectory || join(__dirname, "node_modules", ".bin"); if (!existsSync(this.installDirectory)) { mkdirSync(this.installDirectory, { recursive: true });