diff --git a/handy-scripts/bin/git-create-worktree b/handy-scripts/bin/git-create-worktree deleted file mode 100755 index adc51c9..0000000 --- a/handy-scripts/bin/git-create-worktree +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -[ -z "$1" ] && exit 0 -worktrees="$(git worktree list 2> /dev/null)" -[ -z "$worktrees" ] && exit 0 - -bare="$(echo "$worktrees" | awk 'NR == 1 {print $1}')" -worktree="$1" - -git worktree add -b "$worktree" "$bare/$worktree" 2> /dev/null \ - && exit 0 \ - || git worktree add "$bare/$worktree" && exit 0 diff --git a/handy-scripts/bin/git-remove-worktree b/handy-scripts/bin/git-remove-worktree deleted file mode 100755 index 9de2866..0000000 --- a/handy-scripts/bin/git-remove-worktree +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -worktrees="$(git worktree list 2> /dev/null)" - -[ -z "$worktrees" ] && exit 0 -[ "$(echo "$worktrees" | wc -l)" -eq 1 ] && exit 0 - -selected="$(echo "$worktrees" \ - | awk 'NR > 1 {printf("\033[0;91m%s \033[0;33m%s\033[0m \033[0;36m%s\n", $2, $3, $1)}' \ - | fzf --pointer "" --prompt "  " --border-label " worktree list " --header-first --header "remove worktree " \ - | awk '{print $3}')" - -[ -z "$selected" ] && exit 0 - -session_name=$(basename "$selected") - -git worktree remove "$session_name" diff --git a/handy-scripts/bin/tmux-switch-worktree b/handy-scripts/bin/tmux-switch-worktree deleted file mode 100755 index fa6b6b1..0000000 --- a/handy-scripts/bin/tmux-switch-worktree +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -worktrees="$(git worktree list 2> /dev/null)" - -[ -z "$worktrees" ] && exit 0 -[ "$(echo "$worktrees" | wc -l)" -eq 1 ] && exit 0 - - -selected="$(echo "$worktrees" \ - | awk 'NR > 1 {printf("\033[0;91m%s \033[0;33m%s\033[0m \033[0;36m%s\n", $2, $3, $1)}' \ - | fzf --pointer "" --prompt "  " --border-label " worktree list " --header-first --header "switch worktree " \ - | awk '{print $3}')" - -[ -z "$selected" ] && exit 0 - -session_name=$(basename "$selected") - -# INSIDE TMUX -if [ -n "$TMUX" ]; then - tmux has-session -t $session_name 2> /dev/null \ - && tmux switch-client -t $session_name && exit 0 \ - || tmux new-session -ds $session_name -c $selected && tmux switch-client -t $session_name && exit 0 -fi - -# OUTSIDE TMUX -if [ -z "$TMUX" ]; then - tmux has-session -t $session_name 2> /dev/null \ - && tmux attach-session -t $session_name && exit 0 \ - || tmux new-session -s $session_name -c $selected && exit 0 -fi