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

Commit

Permalink
Merge 3738d04 into f30bd55
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Williams committed Jun 16, 2016
2 parents f30bd55 + 3738d04 commit 3d34771
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 18 deletions.
5 changes: 1 addition & 4 deletions lib/load.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var debug = require('debug')('microboot:load')
var fs = require('fs')
var path = require('path')

Expand All @@ -10,8 +9,6 @@ function load (phases, callback, callbacks) {
var folder = folders.shift()
var absolute_folder = path.resolve(folder)

debug('- loading "' + folder + '"')

var files = fs.readdirSync(absolute_folder)

files.sort()
Expand All @@ -26,4 +23,4 @@ function load (phases, callback, callbacks) {
}

return load(folders, callback, callbacks)
}
}
6 changes: 1 addition & 5 deletions lib/run.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
var debug = require('debug')('microboot:run')

module.exports = run

function run (callbacks, callback) {
var remaining = [].concat(callbacks)
var next = remaining.shift()

debug('- running "' + next.name + '"')

next(function () {
if (!remaining.length) {
return callback()
}

return run(remaining, callback)
})
}
}
7 changes: 1 addition & 6 deletions lib/up.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
var debug = require('debug')('microboot:up')
var load = require('./load')
var run = require('./run')

Expand All @@ -17,11 +16,7 @@ module.exports = function up (phases, callback) {
return callback()
}

debug('Loading phases...')

load(phases, function (callbacks) {
debug('Running phases...', callbacks)

return run(callbacks, callback)
})
}
}
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
},
"author": "Jack Williams <jack@tagstr.co>",
"license": "ISC",
"dependencies": {
"debug": "^2.2.0"
},
"dependencies": {},
"devDependencies": {
"chai": "^3.5.0",
"coveralls": "^2.11.9",
Expand Down

0 comments on commit 3d34771

Please sign in to comment.