diff --git a/README.md b/README.md index 105941d..768566a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ Include this in your gulp file: var opt = { // prefix domain in the `name` param when uploading a file. Leave blank to use the path // verbatim. Do not include a trailing slash. + // Also accepts callback function where filename is passed as single param, must return a string DOMAIN: '', API_URL: 'https://app.getsentry.com/api/0/projects/ORGANIZATION/PROJECT/', API_KEY: 'MY_LONG_API_KEY', diff --git a/index.js b/index.js index f109988..72f2e1f 100644 --- a/index.js +++ b/index.js @@ -88,7 +88,7 @@ module.exports = function (packageFile, opt) { filename: file.relative } }, - name: (opt.DOMAIN || '') + '/' + slash(file.relative) + name: opt.DOMAIN && opt.DOMAIN instanceof Function ? opt.DOMAIN(file.relative) : (opt.DOMAIN || '') + '/' + slash(file.relative) } }, cb); }