Skip to content

Commit

Permalink
fix: Move postinstall script to main lefthook package (#311)
Browse files Browse the repository at this point in the history
Signed-off-by: Valentin Kiselev <[email protected]>
  • Loading branch information
mrexox committed Aug 8, 2022
1 parent 5a19619 commit 0877eb3
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 133 deletions.
5 changes: 1 addition & 4 deletions packaging/npm/lefthook-darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
],
"cpu": [
"arm64"
],
"scripts": {
"install": "node install.js"
}
]
}
21 changes: 0 additions & 21 deletions packaging/npm/lefthook-darwin-x64/install.js

This file was deleted.

5 changes: 1 addition & 4 deletions packaging/npm/lefthook-darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
],
"cpu": [
"x64"
],
"scripts": {
"install": "node install.js"
}
]
}
21 changes: 0 additions & 21 deletions packaging/npm/lefthook-linux-arm64/install.js

This file was deleted.

5 changes: 1 addition & 4 deletions packaging/npm/lefthook-linux-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
],
"cpu": [
"arm64"
],
"scripts": {
"install": "node install.js"
}
]
}
21 changes: 0 additions & 21 deletions packaging/npm/lefthook-linux-x64/install.js

This file was deleted.

5 changes: 1 addition & 4 deletions packaging/npm/lefthook-linux-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
],
"cpu": [
"x64"
],
"scripts": {
"install": "node install.js"
}
]
}
21 changes: 0 additions & 21 deletions packaging/npm/lefthook-windows-arm64/install.js

This file was deleted.

5 changes: 1 addition & 4 deletions packaging/npm/lefthook-windows-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
],
"cpu": [
"arm64"
],
"scripts": {
"install": "node install.js"
}
]
}
21 changes: 0 additions & 21 deletions packaging/npm/lefthook-windows-x64/install.js

This file was deleted.

5 changes: 1 addition & 4 deletions packaging/npm/lefthook-windows-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,5 @@
],
"cpu": [
"x64"
],
"scripts": {
"install": "node install.js"
}
]
}
3 changes: 3 additions & 0 deletions packaging/npm/lefthook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
"lefthook-linux-x64": "1.0.5",
"lefthook-windows-arm64": "1.0.5",
"lefthook-windows-x64": "1.0.5"
},
"scripts": {
"postinstall": "node postinstall.js"
}
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
const path = require("path")
const { spawnSync } = require("child_process")
const { getExePath } = require("./get-exe")

function install() {
if (process.env.CI) {
return
}

const lefthook = path.join(__dirname, "bin", "lefthook")

spawnSync(lefthook, ["install", "-f"], {
spawnSync(getExePath(), ["install", "-f"], {
cwd: process.env.INIT_CWD || process.cwd(),
stdio: "inherit",
})
Expand Down

0 comments on commit 0877eb3

Please sign in to comment.