lefthook 1.6.18 → 1.6.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/get-exe.js +6 -6
- package/package.json +9 -13
- package/postinstall.js +9 -7
- package/bin/index.js +0 -17
package/get-exe.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
const path = require("path")
|
|
1
|
+
const path = require("path");
|
|
2
2
|
|
|
3
3
|
function getExePath() {
|
|
4
4
|
// Detect OS
|
|
5
5
|
// https://nodejs.org/api/process.html#process_process_platform
|
|
6
6
|
let os = process.platform;
|
|
7
|
-
let extension =
|
|
8
|
-
if ([
|
|
9
|
-
os =
|
|
10
|
-
extension =
|
|
7
|
+
let extension = "";
|
|
8
|
+
if (["win32", "cygwin"].includes(process.platform)) {
|
|
9
|
+
os = "windows";
|
|
10
|
+
extension = ".exe";
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// Detect architecture
|
|
14
14
|
// https://nodejs.org/api/process.html#process_process_arch
|
|
15
15
|
let arch = process.arch;
|
|
16
16
|
|
|
17
|
-
return require.resolve(`lefthook-${os}-${arch}/bin/lefthook${extension}`)
|
|
17
|
+
return require.resolve(`lefthook-${os}-${arch}/bin/lefthook${extension}`);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
exports.getExePath = getExePath;
|
package/package.json
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lefthook",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.19",
|
|
4
4
|
"description": "Simple git hooks manager",
|
|
5
|
-
"main": "index.js",
|
|
6
5
|
"repository": "https://github.com/evilmartians/lefthook",
|
|
7
|
-
"bin": {
|
|
8
|
-
"lefthook": "bin/index.js"
|
|
9
|
-
},
|
|
10
6
|
"keywords": [
|
|
11
7
|
"git",
|
|
12
8
|
"hook",
|
|
@@ -20,14 +16,14 @@
|
|
|
20
16
|
},
|
|
21
17
|
"homepage": "https://github.com/evilmartians/lefthook#readme",
|
|
22
18
|
"optionalDependencies": {
|
|
23
|
-
"lefthook-darwin-arm64": "1.6.
|
|
24
|
-
"lefthook-darwin-x64": "1.6.
|
|
25
|
-
"lefthook-linux-arm64": "1.6.
|
|
26
|
-
"lefthook-linux-x64": "1.6.
|
|
27
|
-
"lefthook-freebsd-arm64": "1.6.
|
|
28
|
-
"lefthook-freebsd-x64": "1.6.
|
|
29
|
-
"lefthook-windows-arm64": "1.6.
|
|
30
|
-
"lefthook-windows-x64": "1.6.
|
|
19
|
+
"lefthook-darwin-arm64": "1.6.19",
|
|
20
|
+
"lefthook-darwin-x64": "1.6.19",
|
|
21
|
+
"lefthook-linux-arm64": "1.6.19",
|
|
22
|
+
"lefthook-linux-x64": "1.6.19",
|
|
23
|
+
"lefthook-freebsd-arm64": "1.6.19",
|
|
24
|
+
"lefthook-freebsd-x64": "1.6.19",
|
|
25
|
+
"lefthook-windows-arm64": "1.6.19",
|
|
26
|
+
"lefthook-windows-x64": "1.6.19"
|
|
31
27
|
},
|
|
32
28
|
"scripts": {
|
|
33
29
|
"postinstall": "node postinstall.js"
|
package/postinstall.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
const { spawnSync } = require("child_process")
|
|
2
|
-
const { getExePath } = require("./get-exe")
|
|
1
|
+
const { spawnSync } = require("child_process");
|
|
2
|
+
const { getExePath } = require("./get-exe");
|
|
3
3
|
|
|
4
4
|
function install() {
|
|
5
5
|
if (process.env.CI) {
|
|
6
|
-
return
|
|
6
|
+
return;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
spawnSync(getExePath(), ["install", "-f"], {
|
|
10
10
|
cwd: process.env.INIT_CWD || process.cwd(),
|
|
11
11
|
stdio: "inherit",
|
|
12
|
-
})
|
|
12
|
+
});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
try {
|
|
16
|
-
install()
|
|
17
|
-
} catch(e) {
|
|
18
|
-
console.warn(
|
|
16
|
+
install();
|
|
17
|
+
} catch (e) {
|
|
18
|
+
console.warn(
|
|
19
|
+
"'lefthook install' command failed. Try running it manually.\n" + e,
|
|
20
|
+
);
|
|
19
21
|
}
|
package/bin/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
var spawn = require('child_process').spawn;
|
|
4
|
-
const { getExePath } = require('../get-exe');
|
|
5
|
-
|
|
6
|
-
var command_args = process.argv.slice(2);
|
|
7
|
-
|
|
8
|
-
var child = spawn(
|
|
9
|
-
getExePath(),
|
|
10
|
-
command_args,
|
|
11
|
-
{ stdio: "inherit" });
|
|
12
|
-
|
|
13
|
-
child.on('close', function (code) {
|
|
14
|
-
if (code !== 0) {
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
});
|