mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
test/lazygit: add fish integration test
This does also add a test module for lazygit since there wasn't one already
This commit is contained in:
parent
d375dfc1ff
commit
8929c5f3bc
3 changed files with 29 additions and 0 deletions
3
tests/modules/programs/lazygit/default.nix
Normal file
3
tests/modules/programs/lazygit/default.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
lazygit-fish-integration-enabled = ./fish-integration-enabled.nix;
|
||||||
|
}
|
||||||
18
tests/modules/programs/lazygit/fish-integration-enabled.nix
Normal file
18
tests/modules/programs/lazygit/fish-integration-enabled.nix
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
{ config, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.fish.enable = true;
|
||||||
|
|
||||||
|
home.preferXdgDirectories = false;
|
||||||
|
|
||||||
|
programs.lazygit = {
|
||||||
|
enable = true;
|
||||||
|
shellWrapperName = "lg";
|
||||||
|
enableFishIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileContent home-files/.config/fish/functions/${config.programs.lazygit.shellWrapperName}.fish \
|
||||||
|
${./fish-integration-expected.fish}
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
function lg
|
||||||
|
set -x LAZYGIT_NEW_DIR_FILE ~/.lazygit/newdir
|
||||||
|
command lazygit $argv
|
||||||
|
if test -f $LAZYGIT_NEW_DIR_FILE
|
||||||
|
cd (cat $LAZYGIT_NEW_DIR_FILE)
|
||||||
|
rm -f $LAZYGIT_NEW_DIR_FILE
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue