The sudo adc should make life easier for any admin wishing to run an adc as some other user. As a result, the rmrepo adc also goes back to its simple roots. Now you just run it via the sudo adc if you (as gitolite admin) needs to rmrepo some user's repo.
18 lines
356 B
Bash
Executable file
18 lines
356 B
Bash
Executable file
#!/bin/sh
|
|
|
|
. $(dirname $0)/adc.common-functions
|
|
|
|
delete=$1
|
|
|
|
get_rights_and_owner $delete
|
|
|
|
[ "$owner" = "$GL_USER" ] || die "$delete is not yours to delete!"
|
|
|
|
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
|