From 5b744c262a32a680888c7ae188def8be48c6e40b Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Sat, 23 May 2020 23:05:41 +0300 Subject: [PATCH] Add Global Variable to Get Bin Installation --- index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/index.js b/index.js index 58114cb..6943792 100644 --- a/index.js +++ b/index.js @@ -29,9 +29,8 @@ function getInstallationPath(callback) { // `$npm_execpath bin` will output the path where binary files should be installed // using whichever package manager is current const execPath = process.env.npm_execpath; - const packageManager = execPath.includes("yarn") ? "yarn" : "npm"; + const packageManager = execPath.includes("yarn") ? "yarn global" : "npm"; exec(`${packageManager} bin`, function (err, stdout, stderr) { - console.log({ err, stderr, stdout }); let dir = null; if ( err || @@ -51,7 +50,6 @@ function getInstallationPath(callback) { dir = stdout.trim(); } - console.log({ dir }); mkdirp.sync(dir); callback(null, dir); @@ -174,7 +172,6 @@ function install(callback) { if (!opts) { return callback("Invalid inputs"); } - console.log({ opts }); mkdirp.sync(opts.binPath); let ungz = zlib.createGunzip(); let untar = tar.Extract({ path: opts.binPath });