Skip to content

Commit a09af18

Browse files
committed
Remove polyfill code for old node JS versions
1 parent 7864743 commit a09af18

File tree

2 files changed

+9
-19
lines changed

2 files changed

+9
-19
lines changed

lib/fs-helpers.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,14 @@ var helpers = {
4242
*
4343
* @param {String} path
4444
*/
45-
exists: typeof fs.access === 'function' ?
46-
function (path) {
47-
try {
48-
fs.accessSync(path);
49-
return true;
50-
} catch (err) {
51-
return false;
52-
}
53-
} :
54-
function (path) {
55-
return fs.existsSync(path);
56-
},
45+
exists: function (path) {
46+
try {
47+
fs.accessSync(path);
48+
return true;
49+
} catch (err) {
50+
return false;
51+
}
52+
},
5753

5854
/**
5955
* @param {String} path

lib/git-hooks.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@ module.exports = {
6262
fsHelpers.makeDir(hooksPath);
6363
HOOKS.forEach(function (hookName) {
6464
var hookPath = path.resolve(hooksPath, hookName);
65-
try {
66-
fs.writeFileSync(hookPath, hook, {mode: '0777'});
67-
} catch (e) {
68-
// node 0.8 fallback
69-
fs.writeFileSync(hookPath, hook, 'utf8');
70-
fs.chmodSync(hookPath, '0777');
71-
}
65+
fs.writeFileSync(hookPath, hook, {mode: '0777'});
7266
});
7367
},
7468

0 commit comments

Comments
 (0)