on main help sign in
fix(fsext): only log warnings if log is initialized
commitedd4996a4f89ba56cec018a23ca74aed2ac96d35 authorAyman Bagabas <ayman.bagabas@gmail.com> dateTue 8 Jul 2025, 15:50 (1 year ago) parentf884ff1
1 file changed+7−2
internal/fsext/fileutil.go+7−2
internal/fsext/fileutil.go+7−2
@@ -12,6 +12,7 @@ import (
1212
1313 "github.com/bmatcuk/doublestar/v4"
1414 "github.com/charlievieth/fastwalk"
15+ "github.com/charmbracelet/crush/internal/log"
1516
1617 ignore "github.com/sabhiram/go-gitignore"
1718)
@@ -25,11 +26,15 @@ func init() {
2526 var err error
2627 rgPath, err = exec.LookPath("rg")
2728 if err != nil {
28− slog.Warn("Ripgrep (rg) not found in $PATH. Some features might be limited or slower.")
29+ if log.IsInitialized() {
30+ slog.Warn("Ripgrep (rg) not found in $PATH. Some features might be limited or slower.")
31+ }
2932 }
3033 fzfPath, err = exec.LookPath("fzf")
3134 if err != nil {
32− slog.Warn("FZF not found in $PATH. Some features might be limited or slower.")
35+ if log.IsInitialized() {
36+ slog.Warn("FZF not found in $PATH. Some features might be limited or slower.")
37+ }
3338 }
3439}
3540