hyper/lib/utils/file.js
Martin Ek 7a08b1dc3e Fix xo 0.17 errors and use root xo config for app (#859)
* Use parent xo config in app/

* lint: Fix xo 0.17 errors

* app: add missing semver dependency
2016-10-12 20:35:44 -05:00

23 lines
582 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 function isExecutable(fileStat) {
if (process.platform === 'win32') {
return true;
}
return Boolean(
(fileStat.mode & 0o0001) ||
(fileStat.mode & 0o0010) ||
(fileStat.mode & 0o0100)
);
}