diff --git a/get-prefix.js b/get-prefix.js index ef0e937..97b4cc0 100644 --- a/get-prefix.js +++ b/get-prefix.js @@ -2,7 +2,7 @@ const BB = require('bluebird') -const fs = BB.promisifyAll(require('fs')) +const statAsync = BB.promisify(require('fs').stat) const path = require('path') module.exports = getPrefix @@ -44,7 +44,7 @@ function getPrefix (current, root) { } function fileExists (f) { - return fs.statAsync(f).catch({code: 'ENOENT'}, () => false) + return statAsync(f).catch({code: 'ENOENT'}, () => false) } function isRootPath (p) { diff --git a/index.js b/index.js index 1bcad39..a530aec 100755 --- a/index.js +++ b/index.js @@ -3,7 +3,6 @@ const BB = require('bluebird') -const autoFallback = require('./auto-fallback.js') const child = require('./child') const getPrefix = require('./get-prefix.js') const parseArgs = require('./parse-args.js') @@ -22,7 +21,9 @@ module.exports = main function main (argv) { const shell = argv['shell-auto-fallback'] if (shell || shell === '') { - const fallback = autoFallback(shell, process.env.SHELL, argv) + const fallback = require('./auto-fallback.js')( + shell, process.env.SHELL, argv + ) if (fallback) { console.log(fallback) process.exit(0)