3 # usage: delete <REPOSITORY> - PERMANENTLY delete a repository if existing.
4 # CAREFUL, this action cannot be undone. This command will ask for confirmation.
10 if "$(git --git-dir="$repodir" rev-parse --is-bare-repository)" = true
21 read -p 'Project to delete: ' PROJECT
24 if [ -d ${GITDIR}/${PROJECT}.git
]; then
25 if [[ $
(ls -A ${GITDIR}/${PROJECT}.git
) ]]; then
26 if is_bare
${GITDIR}/${PROJECT}.git
28 echo "You are going to delete the git repository \"${PROJECT}.git\" Do you really want to continue? Note, this action cannot be reverted. [y/N]"
32 rm -rfv ${PROJECT}.git
34 echo "Successfully deleted ${PROJECT}.git"
36 echo "An error occurred while deleting ${PROJECT}.git"
40 echo "Aborting due to user request."
44 echo "you said \"$delAnswer\" which I don't understand. Assuming No. Aborting."
49 echo "\"${PROJECT}.git\" doesn't look like a git repository. Check with your System Administrator."
53 echo "\"${PROJECT}.git\" is an empty directory, Skipping. Check with your System Administrator."