Skip to content

Commit de83155

Browse files
authored
refactor: remove unused catch bindings (#86)
1 parent 5d1a40f commit de83155

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Hook.prototype.log = function log (lines, exit) {
153153
*/
154154
Hook.prototype.initialize = function initialize () {
155155
['git', 'npm'].forEach(function each (binary) {
156-
try { this[binary] = which.sync(binary) } catch (e) {}
156+
try { this[binary] = which.sync(binary) } catch {}
157157
}, this)
158158

159159
//
@@ -164,7 +164,7 @@ Hook.prototype.initialize = function initialize () {
164164
try {
165165
process.env.PATH += path.delimiter + path.dirname(process.env._)
166166
this.npm = which.sync('npm')
167-
} catch (e) {
167+
} catch {
168168
return this.log(this.format(Hook.log.binary, 'npm'), 0)
169169
}
170170
}

install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ if (exists(precommit) && !fs.lstatSync(precommit).isSymbolicLink()) {
9191
// We cannot create a symlink over an existing file so make sure it's gone and
9292
// finish the installation process.
9393
//
94-
try { fs.unlinkSync(precommit) } catch (e) {}
94+
try { fs.unlinkSync(precommit) } catch {}
9595

9696
// Create generic precommit hook that launches this modules hook (as well
9797
// as stashing - unstashing the unstaged changes)

0 commit comments

Comments
 (0)