Skip to content

Commit

Permalink
fix: relative path symlink navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
ALX99 committed Jun 1, 2024
1 parent c649796 commit 4878314
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/models/main_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"io/fs"
"os"
"path"
"path/filepath"
"slices"
"strings"
"sync"
Expand Down Expand Up @@ -137,6 +138,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, nil
}

// If the symlink is relative, we need to resolve it
if !filepath.IsAbs(path) {
path = filepath.Join(m.cwd, path)
}

info, err := os.Stat(path)
if err != nil {
m.lastError = err
Expand Down

0 comments on commit 4878314

Please sign in to comment.