29 lines
795 B
Bash
Executable file
29 lines
795 B
Bash
Executable file
#!/bin/sh
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
delete=$1
|
|
|
|
get_rights_and_owner $delete
|
|
|
|
# please choose one alternative and delete the other para
|
|
|
|
# alternative 1 -- only creator can delete
|
|
[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!"
|
|
|
|
# alternative 2 -- creator or anyone with W access to admin repo can delete
|
|
[ "$owner" = "$GL_USER" ] || {
|
|
# but only if it is wild
|
|
[ "$owner" = "<gitolite>" ] && die "$delete is not a wild repo"
|
|
get_rights_and_owner gitolite-admin
|
|
[ -z "$perm_write" ] && die "$delete is not yours to delete and you're not the admin"
|
|
}
|
|
|
|
cd $GL_REPO_BASE_ABS
|
|
rm -rf $delete.git
|
|
|
|
cd $HOME
|
|
PROJECTS_LIST=$(perl -e 'do ".gitolite.rc"; print $PROJECTS_LIST')
|
|
export delete
|
|
perl -ni -e 'print unless /^\Q$ENV{delete}.git\E$/' $PROJECTS_LIST
|