Skip to content

Commit

Permalink
Merge pull request #88 from sHooKDT/master
Browse files Browse the repository at this point in the history
Fixed path to binaries
  • Loading branch information
Abroskin Alexander authored Nov 16, 2019
2 parents c58013f + 4817222 commit c1d4b8e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .npm/postinstall.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
require("process");
const { spawn } = require("child_process");
const { join } = require("path");

const isCI = process.env.CI;
if (!isCI) {
process.chdir(process.env.INIT_CWD);

if (!isCI) {
if (process.platform === 'darwin') {
binary = 'lefthook-mac';
} else if (process.platform === 'linux') {
Expand All @@ -17,7 +15,10 @@ if (!isCI) {
process.exit(0);
}

binpath = join(process.cwd(), 'node_modules', '@arkweid', 'lefthook', 'bin', binary);
binpath = join(__dirname, 'bin', binary);

result = spawn(binpath, ["install", "-f"], { stdio: [process.stdin, process.stdout, process.stderr] });
result = spawn(binpath, ["install", "-f"], {
cwd: process.env.INIT_CWD,
stdio: [process.stdin, process.stdout, process.stderr]
});
}

0 comments on commit c1d4b8e

Please sign in to comment.