From 1911c1a7c192386ecafd55601fe289f226a06d9c Mon Sep 17 00:00:00 2001 From: punkfairie <23287005+punkfairie@users.noreply.github.com> Date: Sat, 10 Feb 2024 11:21:36 -0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20gitmoji-fuzzy-hook=20as=20a?= =?UTF-8?q?=20submodule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitmodules | 3 +++ git/gitmoji-fuzzy-hook | 1 + git/hooks/prepare-commit-msg | 9 ++++----- git/install.fish | 13 +++---------- 4 files changed, 11 insertions(+), 15 deletions(-) create mode 100644 .gitmodules create mode 160000 git/gitmoji-fuzzy-hook diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e5a8ac0 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "git/gitmoji-fuzzy-hook"] + path = git/gitmoji-fuzzy-hook + url = https://gitlab.com/raabf/gitmoji-fuzzy-hook diff --git a/git/gitmoji-fuzzy-hook b/git/gitmoji-fuzzy-hook new file mode 160000 index 0000000..36b2402 --- /dev/null +++ b/git/gitmoji-fuzzy-hook @@ -0,0 +1 @@ +Subproject commit 36b2402500231a6d69b849e31d5667983f2effb0 diff --git a/git/hooks/prepare-commit-msg b/git/hooks/prepare-commit-msg index ce0b927..e252a55 100755 --- a/git/hooks/prepare-commit-msg +++ b/git/hooks/prepare-commit-msg @@ -17,8 +17,8 @@ ## Dependencies: gitmoji-fuzzy-hook ############################################################################### -[ -t 1 ] # checks if this script is called from a terminal -emoji="$(/Users/marley/.local/share/gitmoji-fuzzy-hook/bin/gitmoji-fuzzy-hook-exec.sh $? $@)" +[ -t 1 ] # checks if this script is called from a terminal +emoji="$(/Users/marley/dotfiles/git/gitmoji-fuzzy-hook/bin/gitmoji-fuzzy-hook-exec.sh $? $@)" msg_file="$1" msg="$(cat "$msg_file")" @@ -26,8 +26,7 @@ msg="$(cat "$msg_file")" # Do here whatever you want with the commit message before prepending the emoji # to it and writing the message to the commit file. -if [ ! -z "${emoji}" ]; then # surpress the space if there is no emoji +if [ ! -z "${emoji}" ]; then # surpress the space if there is no emoji msg="${emoji} ${msg}" fi -echo -e "$msg" > "$msg_file" - +echo -e "$msg" >"$msg_file" diff --git a/git/install.fish b/git/install.fish index 9e19796..bbbd8aa 100755 --- a/git/install.fish +++ b/git/install.fish @@ -9,16 +9,9 @@ print_subtitle Git brew_install "Github CLI" gh -if ! [ -e "$HOME/.local/share/gitmoji-fuzzy-hook/" ] - execute \ - "git clone https://gitlab.com/raabf/gitmoji-fuzzy-hook.git ~/.local/share/gitmoji-fuzzy-hook && \ - ln -f -s ~/.local/share/gitmoji-fuzzy-hook/bin/gitmoji-fuzzy-hook-init.sh $HOME/bin/gitmoji-fuzzy-hook-init" \ - gitmoji-fuzzy-hook -else - execute \ - "cd ~/.local/share/gitmoji-fuzzy-hook/ && git pull; cd $DOT" \ - gitmoji-fuzzy-hook -end +execute \ + "ln -f -s ~/dotfiles/git/gitmoji-fuzzy-hook/bin/gitmoji-fuzzy-hook-init.sh $HOME/bin/gitmoji-fuzzy-hook-init" \ + gitmoji-fuzzy-hook print_subtitle "Git GPG"