hyper/lib/utils/file.js
David Gómez 8f28573fc0 Prefer default export to make XO happy (#931)
* Comply with prefer-default-export rule for findBySession function

* Remove XO's prefer-default-export rule

* Comply with prefer-default-export rule for init function

* Comply with prefer-default-export rule for getRootGroups function

* Comply with prefer-default-export rule for INIT constant

* Comply with prefer-default-export rule for isExecutable function

* Fix default export for constants

* Comply with prefer-default-export rule for last function

* Comply with prefer-default-export rule for getColorList function
2016-10-25 14:53:15 +02:00

23 lines
590 B
JavaScript

/*
* Based on https://github.com/kevva/executable
* Since this module doesn't expose the function to check stat mode only,
* his logic is pasted here.
*
* Opened an issue and a pull request about it,
* to maybe switch to module in the future:
*
* Issue: https://github.com/kevva/executable/issues/9
* PR: https://github.com/kevva/executable/pull/10
*/
export default function isExecutable(fileStat) {
if (process.platform === 'win32') {
return true;
}
return Boolean(
(fileStat.mode & 0o0001) ||
(fileStat.mode & 0o0010) ||
(fileStat.mode & 0o0100)
);
}