From 30309df553f2ca236c5de603f0f7ce178f3e47d1 Mon Sep 17 00:00:00 2001 From: Luca Bilke <luca@bil.ke> Date: Wed, 13 Nov 2024 15:26:56 +0100 Subject: [PATCH] zsh: fix lazygit widget --- common/.config/zsh/config/widgets.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/.config/zsh/config/widgets.zsh b/common/.config/zsh/config/widgets.zsh index a5da5dda..296fdb72 100644 --- a/common/.config/zsh/config/widgets.zsh +++ b/common/.config/zsh/config/widgets.zsh @@ -87,8 +87,8 @@ function lf-wrap() { zle -N lf-wrap function lazygit-wrap() { - [ ! -d "$(pwd)/.git" ] && [[ $(read -erk "?Not in a git repository. Create a new git repository? (y/n): ") =~ ^[Yy]$ ]] && git init - [ -d "$(pwd)/.git" ] && lazygit -p "$(pwd)" + [ ! -d "${PWD}/.git" ] && [[ $(read -erk "?Not in a git repository. Create a new git repository? (y/n): ") =~ ^[Yy]$ ]] && git init "$PWD" + [ -d "${PWD}/.git" ] && lazygit -p "$PWD" reset_prompt } zle -N lazygit-wrap