Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #257 from Financial-Times/CPP-544-remove-secret-sq…
Browse files Browse the repository at this point in the history
…uirrel-commitmsg

CPP-544 remove secret-squirrel commitmsg
  • Loading branch information
emortong authored Jul 21, 2021
2 parents 68a21cc + ad590b3 commit 4c0e306
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
},
"husky": {
"hooks": {
"commit-msg": "secret-squirrel-commitmsg",
"pre-commit": "secret-squirrel",
"pre-push": "make verify -j3"
}
Expand Down
8 changes: 1 addition & 7 deletions scripts/githooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const addScripts = () => {
const json = getPackageJson();
const newJson = [
{ name: 'pre-commit', value: 'secret-squirrel' },
{ name: 'commit-msg', value: 'secret-squirrel-commitmsg' },
{ name: 'pre-push', value: 'make verify -j3' }
].reduce((returnObject, row) => addScript(returnObject, row), json);
return newJson;
Expand Down Expand Up @@ -70,11 +69,6 @@ const secretSquirrelPreCommitScriptExists = () => {
return find(() => json.husky.hooks['pre-commit'].indexOf('secret-squirrel') !== -1);
};

const secretSquirrelCommitmsgScriptExists = () => {
const json = getPackageJson();
return find(() => json.husky.hooks['commit-msg'].indexOf('secret-squirrel-commitmsg') !== -1);
};

const preGitHookExists = () => {
const json = getPackageJson();
return find(() => !!json.config['pre-git'] || json.devDependencies['pre-git']);
Expand All @@ -92,7 +86,7 @@ const run = () => {
require(`${process.cwd()}/node_modules/.bin/husky-upgrade`);
response += 'It upgraded the Husky config format - see https://github.com/Financial-Times/n-gage/issues/220. ';
}
if (!secretSquirrelPreCommitScriptExists() || !secretSquirrelCommitmsgScriptExists()) {
if (!secretSquirrelPreCommitScriptExists()) {
writePackageJsonFile(addScripts);
response += 'It added some githook scripts. ';
};
Expand Down

0 comments on commit 4c0e306

Please sign in to comment.