add --norecursive in git_clone

This commit is contained in:
Konano 2023-07-17 03:38:52 +00:00
parent 044c65a2b3
commit 8c866b9e7a
2 changed files with 12 additions and 4 deletions

View File

@ -10,8 +10,12 @@ git_clone() {
local dir=$2 local dir=$2
if [ ! -d "$dir" ]; then if [ ! -d "$dir" ]; then
if [ "$3" = "--norecursive" ]; then
git clone --single-branch "$github/$repo" $dir
else
git clone --single-branch --recursive "$github/$repo" $dir git clone --single-branch --recursive "$github/$repo" $dir
fi fi
fi
} }
# ============================================================ # ============================================================
@ -120,7 +124,7 @@ configure_tmux() {
if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then
apt install tmux -y apt install tmux -y
git_clone tmux-plugins/tpm ~/.tmux/plugins/tpm git_clone tmux-plugins/tpm ~/.tmux/plugins/tpm --norecursive
git_clone tmux-plugins/tmux-sensible ~/.tmux/plugins/tmux-sensible git_clone tmux-plugins/tmux-sensible ~/.tmux/plugins/tmux-sensible
git_clone tmux-plugins/tmux-yank ~/.tmux/plugins/tmux-yank git_clone tmux-plugins/tmux-yank ~/.tmux/plugins/tmux-yank
git_clone tmux-plugins/tmux-prefix-highlight ~/.tmux/plugins/tmux-prefix-highlight git_clone tmux-plugins/tmux-prefix-highlight ~/.tmux/plugins/tmux-prefix-highlight

View File

@ -10,8 +10,12 @@ git_clone() {
local dir=$2 local dir=$2
if [ ! -d "$dir" ]; then if [ ! -d "$dir" ]; then
if [ "$3" = "--norecursive" ]; then
git clone --single-branch "$github/$repo" $dir
else
git clone --single-branch --recursive "$github/$repo" $dir git clone --single-branch --recursive "$github/$repo" $dir
fi fi
fi
} }
# ============================================================ # ============================================================
@ -120,7 +124,7 @@ configure_tmux() {
if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then if [[ -z "$response" ]] || [[ $response =~ ^[Yy]$ ]]; then
sudo apt install tmux -y sudo apt install tmux -y
git_clone tmux-plugins/tpm ~/.tmux/plugins/tpm git_clone tmux-plugins/tpm ~/.tmux/plugins/tpm --norecursive
git_clone tmux-plugins/tmux-sensible ~/.tmux/plugins/tmux-sensible git_clone tmux-plugins/tmux-sensible ~/.tmux/plugins/tmux-sensible
git_clone tmux-plugins/tmux-yank ~/.tmux/plugins/tmux-yank git_clone tmux-plugins/tmux-yank ~/.tmux/plugins/tmux-yank
git_clone tmux-plugins/tmux-prefix-highlight ~/.tmux/plugins/tmux-prefix-highlight git_clone tmux-plugins/tmux-prefix-highlight ~/.tmux/plugins/tmux-prefix-highlight