Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -731,15 +731,18 @@ setup_file_discovery_tools() {
local missing_packages=()
local missing_names=()

# Check for fd (fd-find)
if ! command -v fd >/dev/null 2>&1; then
local fd_version
if command -v fd >/dev/null 2>&1; then
fd_version=$(fd --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found: $fd_version"
elif command -v fdfind >/dev/null 2>&1; then
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If fdfind exists but fd does not, this reports success even though downstream tooling that invokes fd will still fail in the current shell unless an alias/symlink is configured. Consider warning here (or ensuring the alias setup runs) so fd is actually callable when only fdfind is present.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

fd_version=$(fdfind --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found (as fdfind): $fd_version"
Comment on lines +735 to +740
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The fd_version variable is declared twice, once in the if block and again in the elif block. For better readability and to avoid redundant declarations, consider declaring fd_version once at the beginning of the setup_file_discovery_tools function or just before the if statement.

Suggested change
if command -v fd >/dev/null 2>&1; then
local fd_version
fd_version=$(fd --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found: $fd_version"
elif command -v fdfind >/dev/null 2>&1; then
local fd_version
fd_version=$(fdfind --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found (as fdfind): $fd_version"
local fd_version
# Check for fd (fd-find on Debian/Ubuntu installs as fdfind)
if command -v fd >/dev/null 2>&1; then
fd_version=$(fd --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found: $fd_version"
elif command -v fdfind >/dev/null 2>&1; then
fd_version=$(fdfind --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found (as fdfind): $fd_version"

print_warning "Note: 'fd' alias not active in current shell. Restart shell or run: alias fd=fdfind"
else
missing_tools+=("fd")
missing_packages+=("fd")
missing_names+=("fd (fast file finder)")
else
local fd_version
fd_version=$(fd --version 2>/dev/null | head -1 || echo "unknown")
print_success "fd found: $fd_version"
fi

# Check for ripgrep
Expand Down