Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Add Global Variable to Get Bin Installation
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed May 23, 2020
1 parent cd1b3a6 commit 5b744c2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand All @@ -51,7 +50,6 @@ function getInstallationPath(callback) {
dir = stdout.trim();
}

console.log({ dir });
mkdirp.sync(dir);

callback(null, dir);
Expand Down Expand Up @@ -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 });
Expand Down

0 comments on commit 5b744c2

Please sign in to comment.