Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- #1667
- #1813

- Fix completions for alias `fdfind` in deb release, see #1888 (@skane-lukas)

## Changes

- Minimum required rust version has been increased to 1.90.0. Notably, this means dropping fully support for intel Mac and Windows 7.
Expand Down
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(EXE): Cargo.toml src/**/*.rs
cargo build --profile $(PROFILE) --locked

.PHONY: completions
completions: autocomplete/fd.bash autocomplete/fd.fish autocomplete/_fd.ps1 autocomplete/_fd
completions: autocomplete/fd.bash autocomplete/fd.fish autocomplete/_fd.ps1 autocomplete/_fd autocomplete/_fdfind autocomplete/fdfind.bash autocomplete/fdfind.fish

comp_dir=@mkdir -p autocomplete

Expand All @@ -29,9 +29,24 @@ autocomplete/_fd: contrib/completion/_fd
$(comp_dir)
cp $< $@

autocomplete/_fdfind: contrib/completion/_fdfind
$(comp_dir)
cp $< $@

autocomplete/fdfind.bash: contrib/completion/fdfind.bash
$(comp_dir)
cp $< $@

autocomplete/fdfind.fish: contrib/completion/fdfind.fish
$(comp_dir)
cp $< $@

install: $(EXE) completions
install -Dm755 $(EXE) $(DESTDIR)$(bindir)/fd
install -Dm644 autocomplete/fd.bash $(DESTDIR)/$(datadir)/bash-completion/completions/$(exe_name)
install -Dm644 autocomplete/fd.fish $(DESTDIR)/$(datadir)/fish/vendor_completions.d/$(exe_name).fish
install -Dm644 autocomplete/_fd $(DESTDIR)/$(datadir)/zsh/site-functions/_$(exe_name)
install -Dm644 autocomplete/_fd $(DESTDIR)/$(datadir)/zsh/site-functions/_fd
install -Dm644 autocomplete/fdfind.bash $(DESTDIR)/$(datadir)/zsh/site-functions/fdfind.bash
install -Dm644 autocomplete/fdfind.fish $(DESTDIR)/$(datadir)/zsh/site-functions/fdfind.fish
install -Dm644 autocomplete/_fdfind $(DESTDIR)/$(datadir)/zsh/site-functions/_fdfind
install -Dm644 doc/fd.1 $(DESTDIR)/$(datadir)/man/man1/$(exe_name).1
2 changes: 2 additions & 0 deletions contrib/completion/_fdfind
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#compdef fdfind
_fd "$@"
8 changes: 8 additions & 0 deletions contrib/completion/fdfind.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Source fd completions
source /usr/share/bash-completion/completions/fd

if [[ "${BASH_VERSINFO[0]}" -eq 4 && "${BASH_VERSINFO[1]}" -ge 4 || "${BASH_VERSINFO[0]}" -gt 4 ]]; then
complete -F _fd -o nosort -o bashdefault -o default fdfind
else
complete -F _fd -o bashdefault -o default fdfind
fi
1 change: 1 addition & 0 deletions contrib/completion/fdfind.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
complete -c fdfind --wraps fd
9 changes: 5 additions & 4 deletions scripts/create-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ install -Dm644 "LICENSE-APACHE" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICE
install -Dm644 "CHANGELOG.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
gzip -n --best "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"

# Create symlinks so fdfind can be used as well:
# Create symlink and completions so fdfind can be used as well:
ln -s "/usr/bin/fd" "${DPKG_DIR}/usr/bin/fdfind"
ln -s './fd.bash' "${DPKG_DIR}/usr/share/bash-completion/completions/fdfind"
ln -s './fd.fish' "${DPKG_DIR}/usr/share/fish/vendor_completions.d/fdfind.fish"
ln -s './_fd' "${DPKG_DIR}/usr/share/zsh/vendor-completions/_fdfind"

install -Dm644 'autocomplete/fdfind.bash' "${DPKG_DIR}/usr/share/bash-completion/completions/fdfind"
install -Dm644 'autocomplete/fdfind.fish' "${DPKG_DIR}/usr/share/fish/vendor_completions.d/fdfind.fish"
install -Dm644 'autocomplete/_fdfind' "${DPKG_DIR}/usr/share/zsh/vendor-completions/_fdfind"

cat > "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright" <<EOF
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Expand Down