Skip to content

Commit

Permalink
ci: simple-git-hooks fix
Browse files Browse the repository at this point in the history
  • Loading branch information
motss committed Feb 6, 2022
1 parent 2d5e2dc commit 3956fa2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 19 deletions.
17 changes: 0 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"eslint-plugin-regexp": "^1.5.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"nano-staged": "^0.5.0",
"simple-git-hooks": "^2.7.0",
"typescript": "^4.5.5",
"uvu": "^0.5.3",
"watchlist": "^0.3.0"
Expand Down
9 changes: 8 additions & 1 deletion postinstall.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env zx

const {
CI = false,
CI = 'false',
INIT_CWD = '',
} = process.env;

Expand All @@ -14,7 +14,14 @@ if (CI !== 'true') {
!INIT_CWD.endsWith(`node_modules/${moduleName}`) &&
INIT_CWD.endsWith(moduleName)
) {
/**
* NOTE: To skip running `simple-git-hooks` in CI environment.
* But `npm x -y -- simple-git-hooks@latest` does not work as expected so splitting it into
* a 2-step process: install without saving as dependency then execute it.
*/
await $`npm i --no-save simple-git-hooks`
await $`simple-git-hooks`;

await $`npm dedupe`;
}
}

0 comments on commit 3956fa2

Please sign in to comment.