diff --git a/bin/bake b/bin/bake index 451d821..dfb99d9 100755 --- a/bin/bake +++ b/bin/bake @@ -7,7 +7,7 @@ program .option('-w, --watch', 'Watch for changes') .option('-o, --output [targetPath]', 'Target output path (default: ./dist)') .option('--bakery [pathToBakery]', 'Path to local bakery files') - .option('--buildstyle [oldschool|amd|none]', 'Specify the current build style (default: oldschool = concatenated output)') + .option('--buildstyle [glob|amd|none]', 'Specify the current build style (default: glob)') .option('--refresh', 'Ignore local files and check servers for updates') .on('--help', bake.help) .parse(process.argv); diff --git a/lib/commands/check.js b/lib/commands/check.js index ebc31a0..da83184 100644 --- a/lib/commands/check.js +++ b/lib/commands/check.js @@ -5,7 +5,17 @@ var path = require('path'), bakery = require('../helpers/bakery'); exports = module.exports = function(project, opts) { - var recipe = new Recipe(project, opts); + var recipe; + + // check that we have been provided a project name + // TODO: if not then test each of the recipes + if (typeof project == 'object' && (! (project instanceof String))) { + opts = project; + project = ''; + } + + // initialise the recipe + recipe = new Recipe(project, opts); // ensure we are refreshing to check the actual repository opts.refresh = true; diff --git a/lib/helpers/bakery.js b/lib/helpers/bakery.js index 93ca467..4de0b1b 100644 --- a/lib/helpers/bakery.js +++ b/lib/helpers/bakery.js @@ -1,14 +1,15 @@ var path = require('path'), - fs = require('fs'); + fs = require('fs'), + _existsSync = fs.existsSync || path.existsSync; exports.getPath = function(opts, preferLocal) { var bakeryPath = ''; if (preferLocal) { - if (path.existsSync(path.resolve('recipes'))) { + if (_existsSync(path.resolve('recipes'))) { bakeryPath = process.cwd(); } - else if (path.existsSync(path.resolve('../recipes'))) { + else if (_existsSync(path.resolve('../recipes'))) { bakeryPath = path.resolve('../'); } } diff --git a/lib/recipe.js b/lib/recipe.js index 7eee489..29c5682 100644 --- a/lib/recipe.js +++ b/lib/recipe.js @@ -55,7 +55,7 @@ function Recipe(name, opts) { this.opts = opts || {}; // initialise members - this.buildstyle = this.opts.buildstyle || 'oldschool'; + this.buildstyle = this.opts.buildstyle || 'glob'; this.requirements = []; this.data = ''; this.basePath = process.cwd();