diff --git a/home/programs/git/default.nix b/home/programs/git/default.nix index 56a37a2..716c4bc 100644 --- a/home/programs/git/default.nix +++ b/home/programs/git/default.nix @@ -262,6 +262,14 @@ in runtimeInputs = with pkgs; [ cfg.package coreutils ]; text = lib.fileContents ./scripts/git-tcommit.sh; }) + (pkgs.writeShellApplication { + name = "git-tmcommit"; + runtimeInputs = with pkgs; [ cfg.package coreutils ]; + text = lib.pipe ./scripts/git-tcommit.sh [ + lib.fileContents + (builtins.replaceStrings ["hours" "tcommit"] ["minutes" "tmcommit"]) + ]; + }) (pkgs.writeShellApplication { name = "git-switch-interactive"; runtimeInputs = with pkgs; [ cfg.package fzf gnused coreutils ]; diff --git a/home/programs/git/scripts/git-tcommit.sh b/home/programs/git/scripts/git-tcommit.sh index 991343d..e60dce6 100755 --- a/home/programs/git/scripts/git-tcommit.sh +++ b/home/programs/git/scripts/git-tcommit.sh @@ -1,5 +1,10 @@ set -euo pipefail +if [[ $# -lt 1 ]]; then + echo "Usage: git tcommit [-]" + exit 1 +fi + HOUR_SHIFT="$1" shift