Skip to content

Commit

Permalink
windows hax
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Jan 8, 2025
1 parent eb7ae27 commit 6ceda98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/slackdump/internal/ui/bubbles/filemgr/filemgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (m Model) Init() tea.Cmd {
}

func readFS(fsys fs.FS, dir string, globs ...string) (wmReadDir, error) {
sub, err := fs.Sub(fsys, dir)
sub, err := fs.Sub(fsys, filepath.Clean(dir))
if err != nil {
return wmReadDir{}, fmt.Errorf("sub: %w", err)
}
Expand All @@ -107,7 +107,7 @@ func readFS(fsys fs.FS, dir string, globs ...string) (wmReadDir, error) {
if err != nil {
return wmReadDir{}, fmt.Errorf("collectFiles: %w", err)
}
if !(dir == "." || dir == "/" || dir == "") {
if dir != "." && dir != string(filepath.Separator) && dir != "" {
files = append([]fs.FileInfo{specialDir{".."}}, files...)
}
return wmReadDir{dir, append(files, dirs...)}, nil
Expand Down

0 comments on commit 6ceda98

Please sign in to comment.