2010-06-01 12:57:33 +02:00
|
|
|
#!/bin/sh
|
2010-04-24 19:30:38 +02:00
|
|
|
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
|
|
|
|
delete=$1
|
|
|
|
|
|
|
|
get_rights_and_owner $delete
|
2010-08-20 06:15:05 +02:00
|
|
|
|
|
|
|
# please choose one alternative and delete the other para
|
|
|
|
|
|
|
|
# alternative 1 -- only creator can delete
|
2010-06-01 12:57:33 +02:00
|
|
|
[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!"
|
2010-04-24 19:30:38 +02:00
|
|
|
|
2010-08-20 06:15:05 +02:00
|
|
|
# alternative 2 -- creator or anyone with W access to admin repo can delete
|
|
|
|
[ "$owner" = "$GL_USER" ] || {
|
|
|
|
get_rights_and_owner gitolite-admin
|
|
|
|
[ -z "$perm_write" ] && die "$delete is not yours to delete and you're not the admin"
|
|
|
|
}
|
|
|
|
|
2010-04-24 19:30:38 +02:00
|
|
|
cd $GL_REPO_BASE_ABS
|
|
|
|
rm -rf $delete.git
|