Run tmux-sessionizer after cloning a repo

This commit is contained in:
Oliver Davies 2025-01-19 12:53:49 +00:00
parent 2f5636c127
commit e04bededf3

View file

@ -30,19 +30,39 @@
alias -s {zip,ZIP}="unzip -l" alias -s {zip,ZIP}="unzip -l"
git() { git() {
if [[ "''${1}" == "root" ]]; then case "$1" in
shift clone)
shift
local ROOT="$(${pkgs.git}/bin/git rev-parse --show-toplevel 2> /dev/null || echo -n .)" local repo_url="$1"
local repo_path="''${2:-}"
if [[ $# == 0 ]]; then if [ -n "$TARGET_DIR" ]; then
cd "''${ROOT}" command git clone "$repo_url" "$repo_path"
else else
(cd "''${ROOT}" && eval "''${@}") command git clone "$repo_url"
fi repo_path=$(basename "$repo_url" .git)
else fi
${pkgs.git}/bin/git "''${@}"
fi ${pkgs.tmux-sessionizer}/bin/tmux-sessionizer "$repo_path"
;;
root)
shift
local ROOT="$(${pkgs.git}/bin/git rev-parse --show-toplevel 2> /dev/null || echo -n .)"
if [[ $# == 0 ]]; then
cd "''${ROOT}"
else
(cd "''${ROOT}" && eval "''${@}")
fi
;;
*)
${pkgs.git}/bin/git "''${@}"
;;
esac
} }
ttyper() { ttyper() {