Skip to content

Commit

Permalink
Better mechanism for parent directory
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Oct 14, 2016
1 parent 2344030 commit 6378d4c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/list
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,20 @@ const renderDirectory = async dir => {
}
}

const directory = path.join(path.basename(current), subPath, '/')
const pathParts = directory.split('/')

if (dir.indexOf(current + '/') > -1) {
const directoryPath = pathParts
directoryPath.shift()

files.unshift({
base: '..',
relative: '..'
relative: path.join(...pathParts, '..')
})
}

const render = prepareView()
const directory = path.join(path.basename(current), subPath, '/')
const pathParts = directory.split('/')

const paths = []
pathParts.pop()
Expand Down

0 comments on commit 6378d4c

Please sign in to comment.