Skip to content

Commit

Permalink
fix: Force update prepare script
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 11, 2024
1 parent c1f017a commit 67ee6d2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/modify-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ try {
throw 'Unable to modify ' + filename;
}

function configure(command, impl, strict = true) {
if (pkg.scripts[command]) {
function configure(command, impl, force = false) {
if (pkg.scripts[command] && !force) {
if (pkg.scripts[command] !== impl && strict) {
throw `Lint command '${command}' already configured with different program`;
}
Expand All @@ -24,5 +24,6 @@ function configure(command, impl, strict = true) {
configure('lint', 'lint update && lint');
configure('lint:fix', 'lint update && lint fix');
configure('pre-commit', 'lint update && lint-staged');
configure('prepare', 'husky || true', true);

writeFileSync(filename, JSON.stringify(pkg, null, 2), 'utf8');

0 comments on commit 67ee6d2

Please sign in to comment.