Skip to content

Commit

Permalink
runner: make fd also look for symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
abenz1267 committed Jan 14, 2025
1 parent 5ba2c3c commit 1b8f924
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.2-git
0.12.2
16 changes: 9 additions & 7 deletions internal/modules/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"path/filepath"
"slices"
"strings"
"time"

"github.com/abenz1267/walker/internal/config"
"github.com/abenz1267/walker/internal/util"
Expand Down Expand Up @@ -143,10 +142,8 @@ func (r *Runner) getBins() {

bins := []string{}

now := time.Now()

if config.Cfg.Builtins.Runner.UseFD {
args := []string{".", "--no-ignore-vcs", "--type", "executable"}
args := []string{".", "--no-ignore-vcs", "--type", "executable", "--type", "symlink"}
args = append(args, paths...)

cmd := exec.Command("fd", args...)
Expand All @@ -156,7 +153,14 @@ func (r *Runner) getBins() {
scanner := bufio.NewScanner(bytes.NewReader(out))

for scanner.Scan() {
bins = append(bins, filepath.Base(scanner.Text()))
info, err := os.Stat(scanner.Text())
if info == nil || err != nil {
continue
}

if info.Mode()&0111 != 0 {
bins = append(bins, filepath.Base(scanner.Text()))
}
}
}
} else {
Expand All @@ -180,8 +184,6 @@ func (r *Runner) getBins() {
}
}

fmt.Println(time.Since(now))

for k := range r.aliases {
bins = append(bins, k)
}
Expand Down

0 comments on commit 1b8f924

Please sign in to comment.