Skip to content

Commit

Permalink
[#110] Fix duplication of the last path element for paths which do no…
Browse files Browse the repository at this point in the history
…t have the -prefix to strip.
  • Loading branch information
Andreas Kupries committed May 12, 2016
1 parent a0ff256 commit b7d2e98
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion convert.go
Expand Up @@ -198,7 +198,13 @@ func findFiles(dir, prefix string, recursive bool, toc *[]Asset, ignore []*regex
if strings.HasPrefix(asset.Name, prefix) {
asset.Name = asset.Name[len(prefix):]
} else {
asset.Name = filepath.Join(dir, file.Name())
asset.Name = dir
// Note that 'dir' already contains the full
// path name (minus the basedir). Joining the
// file.Name() to that generates a broken path
// where the last element is duplicated,
// i.e. a path like "foo/bar" becomes
// "foo/bar/bar", which is a bit of a snafu ;)
}

// If we have a leading slash, get rid of it.
Expand Down

0 comments on commit b7d2e98

Please sign in to comment.