commit outputs can now be colored with a new script color-commit

This commit is contained in:
2024-11-17 13:03:49 -05:00
parent 76be210ec3
commit beedfd1be2
8 changed files with 66 additions and 14 deletions

View File

@@ -6,7 +6,6 @@
shellAliases = {
grep = "grep --color=auto";
yazi = "y";
vi = "nvim";
mv = "mv -v";
cp = "cp -vr";
gt = "gtrash";

View File

@@ -2,6 +2,7 @@
let
shellsound = "${pkgs.myScripts.playshellsound}/bin/playshellsound";
color-commit = "${pkgs.myScripts.color-commit}/bin/color-commit";
sndpath = "${self}/assets/sound";
in
{
@@ -59,11 +60,14 @@ in
fi
}
gitcommit_sfx() {
if git commit "$@"; then
output=$(git commit "$@")
if [ -n "$output" ]; then
${shellsound} ${sndpath}/gitcommit.wav
echo "$output" | ${color-commit}
return 0
else
${shellsound} ${sndpath}/error.wav
echo "$output"
return 1
fi
}