mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
lazygit: fix nushell and fish integrations
This commit is contained in:
parent
87044c5722
commit
ae22fa930e
1 changed files with 16 additions and 9 deletions
|
|
@ -85,10 +85,15 @@ in
|
||||||
|
|
||||||
programs =
|
programs =
|
||||||
let
|
let
|
||||||
|
lazygitNewDirFilePath =
|
||||||
|
if config.home.preferXdgDirectories then
|
||||||
|
"${config.xdg.cacheHome}/lazygit/newdir"
|
||||||
|
else
|
||||||
|
"~/.lazygit/newdir";
|
||||||
|
|
||||||
bashIntegration = ''
|
bashIntegration = ''
|
||||||
${cfg.shellWrapperName}()
|
${cfg.shellWrapperName}() {
|
||||||
{
|
export LAZYGIT_NEW_DIR_FILE=${lazygitNewDirFilePath}
|
||||||
export LAZYGIT_NEW_DIR_FILE=~/.lazygit/newdir
|
|
||||||
lazygit "$@"
|
lazygit "$@"
|
||||||
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
|
if [ -f $LAZYGIT_NEW_DIR_FILE ]; then
|
||||||
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
|
cd "$(cat $LAZYGIT_NEW_DIR_FILE)"
|
||||||
|
|
@ -98,17 +103,19 @@ in
|
||||||
'';
|
'';
|
||||||
|
|
||||||
fishIntegration = ''
|
fishIntegration = ''
|
||||||
set -x LAZYGIT_NEW_DIR_FILE ~/.lazygit/newdir
|
function ${cfg.shellWrapperName}
|
||||||
command lazygit $argv
|
set -x LAZYGIT_NEW_DIR_FILE ${lazygitNewDirFilePath}
|
||||||
if test -f $LAZYGIT_NEW_DIR_FILE
|
command lazygit $argv
|
||||||
cd (cat $LAZYGIT_NEW_DIR_FILE)
|
if test -f $LAZYGIT_NEW_DIR_FILE
|
||||||
rm -f $LAZYGIT_NEW_DIR_FILE
|
cd (cat $LAZYGIT_NEW_DIR_FILE)
|
||||||
|
rm -f $LAZYGIT_NEW_DIR_FILE
|
||||||
|
end
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nushellIntegration = ''
|
nushellIntegration = ''
|
||||||
def --env ${cfg.shellWrapperName} [...args] {
|
def --env ${cfg.shellWrapperName} [...args] {
|
||||||
$env.LAZYGIT_NEW_DIR_FILE = "~/.lazygit/newdir"
|
$env.LAZYGIT_NEW_DIR_FILE = "${lazygitNewDirFilePath}" | path expand
|
||||||
lazygit ...$args
|
lazygit ...$args
|
||||||
if ($env.LAZYGIT_NEW_DIR_FILE | path exists) {
|
if ($env.LAZYGIT_NEW_DIR_FILE | path exists) {
|
||||||
cd (open $env.LAZYGIT_NEW_DIR_FILE)
|
cd (open $env.LAZYGIT_NEW_DIR_FILE)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue