diff options
Diffstat (limited to 'deps/npm/lib/utils/is-hashbang-file.js')
-rw-r--r-- | deps/npm/lib/utils/is-hashbang-file.js | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/deps/npm/lib/utils/is-hashbang-file.js b/deps/npm/lib/utils/is-hashbang-file.js deleted file mode 100644 index f1677381fa..0000000000 --- a/deps/npm/lib/utils/is-hashbang-file.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict' -const Bluebird = require('bluebird') -const fs = require('graceful-fs') -const open = Bluebird.promisify(fs.open) -const close = Bluebird.promisify(fs.close) - -module.exports = isHashbangFile - -function isHashbangFile (file) { - return open(file, 'r').then((fileHandle) => { - return new Bluebird((resolve, reject) => { - fs.read(fileHandle, new Buffer(new Array(2)), 0, 2, 0, function (err, bytesRead, buffer) { - close(fileHandle).then(() => { - resolve(!err && buffer.toString() === '#!') - }).catch(reject) - }) - }) - }) -} |