Skip to content

Commit

Permalink
support default variant
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Aug 9, 2012
1 parent 1317f2b commit 338fca4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/imager.js
Expand Up @@ -39,6 +39,9 @@ Imager.prototype.upload = function (files, callback, variant) {
if (typeof variant !== 'string' && !this.config.variants.default)
throw new Error('Please specify a proper variant OR provide a default variant in your imager config')

if (!variant && this.config.variants.default)
var variant = 'default'

if (typeof variant === 'string' && !this.config.variants[variant])
throw new Error('Please provide a variant which you have specified in the config file')

Expand Down

0 comments on commit 338fca4

Please sign in to comment.