Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Commit

Permalink
fix(startup): delay loading some things to speed up startup
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed Jun 3, 2017
1 parent f2fa6b3 commit 6b32bf5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions get-prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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)
Expand Down

0 comments on commit 6b32bf5

Please sign in to comment.