Skip to content

Instantly share code, notes, and snippets.

@h2non
Last active December 31, 2015 12:19
Show Gist options
  • Save h2non/7985698 to your computer and use it in GitHub Desktop.
Save h2non/7985698 to your computer and use it in GitHub Desktop.
styleguide absolute path issue fix
// origin source: https://github.com/indieisaconcept/grunt-styleguide/blob/master/tasks/styleguide.js#L221
styleguide.files = {
file: file,
src: files.length > 0 && files || grunt.file.exists(file.orig.src) && file.orig.src,
dest: file.dest
};
styleguide.files.base = (function () {
var base;
if (files.length) {
// note that it define the base path based only on the first existent path
if (grunt.file.isPathAbsolute(files[0])) {
base = path.dirname(files[0]);
} else {
base = helper.findBasePath(files) || './';
}
}
return base || './';
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment