Skip to content

Commit bc81f0c

Browse files
committed
optimize code
1 parent 818ff26 commit bc81f0c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

simple-git-hooks.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,17 @@ function _setHook(hook, command, projectRoot=process.cwd()) {
212212
* @param {string} projectRoot
213213
* @param {string[]} [argv]
214214
*/
215-
function removeHooks(projectRoot = process.cwd(), argv = process.argv) {
216-
const customConfigPath = _getCustomConfigPath(argv)
215+
function removeHooks(projectRoot = process.cwd()) {
216+
const customConfigPath = _getCustomConfigPath(process.argv)
217217
const config = _getConfig(projectRoot, customConfigPath)
218218

219219
if (!config) {
220220
throw ('[ERROR] Config was not found! Please add `.simple-git-hooks.js` or `simple-git-hooks.js` or `.simple-git-hooks.json` or `simple-git-hooks.json` or `simple-git-hooks` entry in package.json.\r\nCheck README for details')
221221
}
222222

223223
const preserveUnused = Array.isArray(config.preserveUnused) ? config.preserveUnused : []
224-
const needRemoveHooks = VALID_GIT_HOOKS.filter(hook => !preserveUnused.includes(hook))
225-
for (let configEntry of needRemoveHooks) {
224+
const hooksToRemove = VALID_GIT_HOOKS.filter(hook => !preserveUnused.includes(hook))
225+
for (let configEntry of hooksToRemove) {
226226
_removeHook(configEntry, projectRoot)
227227
}
228228
}

0 commit comments

Comments
 (0)