1
0
Fork 0
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:
SunOfLife1 2025-11-05 13:22:53 -05:00 committed by Austin Horstman
parent d375dfc1ff
commit 8929c5f3bc
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{
lazygit-fish-integration-enabled = ./fish-integration-enabled.nix;
}

View 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}
'';
}

View file

@ -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