lefthook 1.6.18 → 1.6.21

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/bin/index.js CHANGED
File without changes
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 (['win32', 'cygwin'].includes(process.platform)) {
9
- os = 'windows';
10
- extension = '.exe';
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,9 +1,9 @@
1
1
  {
2
2
  "name": "lefthook",
3
- "version": "1.6.18",
3
+ "version": "1.6.21",
4
4
  "description": "Simple git hooks manager",
5
- "main": "index.js",
6
5
  "repository": "https://github.com/evilmartians/lefthook",
6
+ "main": "bin/index.js",
7
7
  "bin": {
8
8
  "lefthook": "bin/index.js"
9
9
  },
@@ -20,14 +20,14 @@
20
20
  },
21
21
  "homepage": "https://github.com/evilmartians/lefthook#readme",
22
22
  "optionalDependencies": {
23
- "lefthook-darwin-arm64": "1.6.18",
24
- "lefthook-darwin-x64": "1.6.18",
25
- "lefthook-linux-arm64": "1.6.18",
26
- "lefthook-linux-x64": "1.6.18",
27
- "lefthook-freebsd-arm64": "1.6.18",
28
- "lefthook-freebsd-x64": "1.6.18",
29
- "lefthook-windows-arm64": "1.6.18",
30
- "lefthook-windows-x64": "1.6.18"
23
+ "lefthook-darwin-arm64": "1.6.21",
24
+ "lefthook-darwin-x64": "1.6.21",
25
+ "lefthook-linux-arm64": "1.6.21",
26
+ "lefthook-linux-x64": "1.6.21",
27
+ "lefthook-freebsd-arm64": "1.6.21",
28
+ "lefthook-freebsd-x64": "1.6.21",
29
+ "lefthook-windows-arm64": "1.6.21",
30
+ "lefthook-windows-x64": "1.6.21"
31
31
  },
32
32
  "scripts": {
33
33
  "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("'lefthook install' command failed. Try running it manually.\n" + e)
16
+ install();
17
+ } catch (e) {
18
+ console.warn(
19
+ "'lefthook install' command failed. Try running it manually.\n" + e,
20
+ );
19
21
  }