From b0b8f778f27f99d57a74a235436dfe5b7bc2767d Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Wed, 3 Apr 2024 16:46:18 +0200 Subject: [PATCH] [setup] added office git setup script --- setup/git.office.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 setup/git.office.sh diff --git a/setup/git.office.sh b/setup/git.office.sh new file mode 100755 index 0000000..6d5b00a --- /dev/null +++ b/setup/git.office.sh @@ -0,0 +1,34 @@ +#!/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