diff --git a/index.js b/index.js index 8a1656d..741c016 100644 --- a/index.js +++ b/index.js @@ -153,7 +153,7 @@ Hook.prototype.log = function log (lines, exit) { */ Hook.prototype.initialize = function initialize () { ['git', 'npm'].forEach(function each (binary) { - try { this[binary] = which.sync(binary) } catch (e) {} + try { this[binary] = which.sync(binary) } catch {} }, this) // @@ -164,7 +164,7 @@ Hook.prototype.initialize = function initialize () { try { process.env.PATH += path.delimiter + path.dirname(process.env._) this.npm = which.sync('npm') - } catch (e) { + } catch { return this.log(this.format(Hook.log.binary, 'npm'), 0) } } diff --git a/install.js b/install.js index e6d4f6f..4ce2bf2 100644 --- a/install.js +++ b/install.js @@ -91,7 +91,7 @@ if (exists(precommit) && !fs.lstatSync(precommit).isSymbolicLink()) { // We cannot create a symlink over an existing file so make sure it's gone and // finish the installation process. // -try { fs.unlinkSync(precommit) } catch (e) {} +try { fs.unlinkSync(precommit) } catch {} // Create generic precommit hook that launches this modules hook (as well // as stashing - unstashing the unstaged changes)