BrowserSync / UI

User interface for BrowserSync
Apache License 2.0
336 stars 44 forks source link

Do not load hidden folders #34

Open LostKobrakai opened 8 years ago

LostKobrakai commented 8 years ago

I'm using netatalk for network sharing with mac osx and this does add a .AppleDouble folder to each folder inside the shared path. The browser-sync-ui module does try to load this folder as file here

I've solved this by adding a line to exclude all "files" which start with a dot, but I'm not sure if this is really the correct way to fix this issue.

function createInlineTemplates (hooks) {
    return hooks.reduce(function (combined, item) {
        return combined + item.reduce(function (all, filepath) {
            if(path.basename(filepath).substr(0, 1) == '.') return null;
            return all + angularWrap(
                path.basename(filepath),
                fs.readFileSync(filepath));
        }, "");
    }, "");
}