This repository has been archived on 2024-07-10. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles-nix/setup/git.personal.sh

55 lines
1.0 KiB
Bash
Raw Normal View History

2024-03-29 20:25:25 +01:00
#!/usr/bin/env zsh
# config
git_host="git.simoncor.net"
git_token=""
git_user="siempie"
2024-04-03 16:46:12 +02:00
git_repo_dir=~/Documents/git/"siempie"
2024-03-29 20:25:25 +01:00
git_repos=(
"ansible"
"ansible-deployment-container"
"docs"
"dotfiles"
"dotfiles-nix"
"hugo-sws"
2024-05-01 11:11:51 +02:00
"kaas-drone"
2024-05-06 10:49:49 +02:00
"kaas-hackerboys"
2024-05-01 11:11:51 +02:00
"kaas-mail2most"
2024-04-26 16:54:00 +02:00
"kaas-phpipam"
"kaas-roundcube"
"kaas-simoncor-net"
"kaas-start-simoncor-net"
2024-05-01 11:11:51 +02:00
"kaas-vaultwarden"
2024-03-29 20:25:25 +01:00
"kubernetes"
"renovate"
"roundcube"
"scripts"
"simoncor.net"
"start.simoncor.net"
"terraform"
)
# get the git token
vared -p "Enter your git token: " -c git_token
echo ""
# create folder if it doesn't exist
mkdir -p "${git_repo_dir}"
# clone repositories
for git_repo in "${git_repos[@]}"; do
# check if repo exists
if [ -f ${git_repo_dir}/${git_repo} ]; then
echo "🚫 error: directory exists"
exit
fi
# clone repository
git clone https://${git_user}:${git_token}@${git_host}/${git_user}/${git_repo} ${git_repo_dir}/${git_repo} &> /dev/null
# print success message
echo "✅ done: ${git_host}/${git_user}/${git_repo}"
2024-03-29 20:25:25 +01:00
done