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

Commit

Permalink
Updated buildstyles to use glob rather than oldschool
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Oehlman committed Jul 24, 2012
1 parent fd39f38 commit fe2b8cb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/bake
Expand Up @@ -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);
Expand Down
12 changes: 11 additions & 1 deletion lib/commands/check.js
Expand Up @@ -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;
Expand Down
7 changes: 4 additions & 3 deletions 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('../');
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/recipe.js
Expand Up @@ -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();
Expand Down

0 comments on commit fe2b8cb

Please sign in to comment.