diff --git a/lib/sound-browser.js b/lib/sound-browser.js index ff772f5..87f55dd 100644 --- a/lib/sound-browser.js +++ b/lib/sound-browser.js @@ -17,7 +17,11 @@ export default class SoundBrowser { let trees = soundFolders .map(folder => { - let tree = dirTree(folder, { extensions: /\.(wav|aiff)/, exclude: /.git/ }) + let tree = dirTree(folder, { + extensions: /\.(wav|aiff)/, + exclude: /.git/, + attributes: ['type'] + }) if (!tree) { atom.notifications.addError(`Sound browser: the path ${folder} is invalid`) } @@ -44,7 +48,7 @@ export default class SoundBrowser { rootElement.appendChild(element) - if (tree.children.length > 0) { + if (tree.type === 'directory') { element.textContent = tree.name element.classList.add('icon', 'icon-open')