Permalink
Browse files

quick patch for command-line builds again

  • Loading branch information...
1 parent 1a2cfcc commit 8dede06fdc40e50e1fe0cdc960bf95c56b7f32d3 @hunterloftis hunterloftis committed Jul 17, 2012
Showing with 8 additions and 6 deletions.
  1. +6 −4 bin/mason
  2. +1 −1 lib/renderer.js
  3. +1 −1 package.json
  4. 0 test/bin.test.js
View
@@ -11,13 +11,15 @@ program
program
.command('build')
- .description('build mason.json targets')
+ .description('build assets')
+ .option('-f, --file [assets]', 'JSON file with asset descriptions [mason.json]', 'mason.json')
.option('-j, --javascript [renderer]', 'specify the renderer for JS [uglify]', 'uglify')
.action(runBuild);
program
.command('watch')
.description('build and watch mason.json targets')
+ .option('-f, --file [configFile]', 'JSON file with asset descriptions')
.option('-j, --javascript [renderer]', 'specify the renderer for JS [uglify]', 'uglify')
.action(runWatch);
@@ -29,9 +31,9 @@ else {
}
function runBuild(options) {
- mason.build(process.cwd(), {
- 'javascript': options.javascript
- });
+ mason({
+ file: options.file
+ }).build();
}
function runWatch(options) {
View
@@ -15,7 +15,7 @@ Renderer.prototype.render = function(assetName) {
if (!asset) {
throw new Error("Unable to find mason asset '" + assetName + "'");
}
- var mode = this.config.modes[assetName] || asset.renderer || Renderer.defaultModes[asset.type];
+ var mode = (this.config.modes && this.config.modes[assetName]) || asset.renderer || Renderer.defaultModes[asset.type];
var writer = Renderer.writers[mode];
this.config.prefix = this.config.prefix || '';
return writer(asset, this.config);
View
@@ -1,6 +1,6 @@
{
"name": "mason",
- "version": "0.1.0",
+ "version": "0.1.1",
"description": "simple, fun, static-file builder for jade, stylus, and javascript",
"keywords": ["build", "compile", "concatenate", "minify", "uglify", "jade", "stylus", "javascript"],
"author": "Hunter Loftis <hunter@hunterloftis.com>",
View
No changes.

0 comments on commit 8dede06

Please sign in to comment.