Skip to content

Commit

Permalink
fix(repo-config): if ornikar-lint-staged missing run yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Jul 13, 2023
1 parent a198d33 commit 5eaf47d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion @ornikar/repo-config/lib/postinstall/install-husky.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,16 @@ module.exports = function installHusky({ pkg, pm }) {
const pmExec = pm.name === 'npm' ? 'npx --no-install' : pm.name;

writeHook('commit-msg', `${pmExec} commitlint --edit $1`);
writeHook('pre-commit', `${pmExec} ornikar-lint-staged`);
writeHook(
'pre-commit',
`
if [ ! -f node_modules/.bin/ornikar-lint-staged ]; then
${pmExec}
fi
${pmExec} ornikar-lint-staged
`,
);

const runCleanCache = shouldRunCleanCacheOnDependenciesChanges();
if (isYarnPnp && !runCleanCache) {
Expand Down

0 comments on commit 5eaf47d

Please sign in to comment.