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.office.sh

35 lines
735 B
Bash
Raw Permalink Normal View History

2024-04-03 16:46:18 +02:00
#!/usr/bin/env zsh
# config
git_host="gitlab.itcreation.nl"
git_token=""
git_user="admscornet"
git_repo_dir=~/Documents/git/"IT creation"
git_repos=(
"itc-ansible"
)
# 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}"
done