Skip to content

Commit

Permalink
fix: adjust tree file path if it's a plugin (fix #276) (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
epr3 authored Aug 13, 2023
1 parent f879e7b commit 5d902aa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/histoire/src/node/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ export function createPath (config: HistoireConfig, file: ServerTreeFile) {

if (config.tree.file === 'path') {
const paths = file.path.split('/').slice(0, -1)

// check if tree file path is a plugin
const index = paths.findIndex(p => p.includes('.histoire'))

if (index !== -1) {
return ['plugins', file.title]
}

return [...paths, file.title]
}

Expand Down

0 comments on commit 5d902aa

Please sign in to comment.