fzf-git-sh: add support for fish (#439958)
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
util-linux,
|
||||
xdg-utils,
|
||||
zsh,
|
||||
fish,
|
||||
unstableGitUpdater,
|
||||
}:
|
||||
|
||||
@@ -29,6 +30,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
dontBuild = true;
|
||||
doInstallCheck = true;
|
||||
|
||||
postPatch = ''
|
||||
sed -i \
|
||||
@@ -50,17 +52,30 @@ stdenv.mkDerivation rec {
|
||||
-e "s,__fzf_git=.*BASH_SOURCE.*,__fzf_git=$out/share/${pname}/fzf-git.sh," \
|
||||
-e "/__fzf_git=.*readlink.*/d" \
|
||||
fzf-git.sh
|
||||
|
||||
sed -i \
|
||||
-e "s,\bbash\b,${bash}/bin/bash," \
|
||||
-e "s,\''$fzf_git_sh_path\b,$out/share/${pname}," \
|
||||
fzf-git.fish
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -D fzf-git.sh $out/share/${pname}/fzf-git.sh
|
||||
install -D fzf-git.fish $out/share/${pname}/fzf-git.fish
|
||||
'';
|
||||
|
||||
# Smoke test
|
||||
installCheckPhase = ''
|
||||
export HOME=$(mktemp -d)
|
||||
${bash}/bin/bash -c "source $out/share/${pname}/fzf-git.sh"
|
||||
${fish}/bin/fish -c "source $out/share/${pname}/fzf-git.fish"
|
||||
'';
|
||||
|
||||
passthru.updateScript = unstableGitUpdater { };
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/junegunn/fzf-git.sh";
|
||||
description = "Bash and zsh key bindings for Git objects, powered by fzf";
|
||||
description = "Bash, zsh and fish key bindings for Git objects, powered by fzf";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ deejayem ];
|
||||
platforms = platforms.all;
|
||||
|
||||
Reference in New Issue
Block a user