[projects/git-slug: 115/170] adc/trash: take ATTIC and WATCHDIR from environment
glen
glen at pld-linux.org
Mon Sep 21 21:48:28 CEST 2015
commit bab1af60c4a2814b98398af57b1fbff1a20d736c
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Mon Jun 25 08:22:40 2012 +0100
adc/trash: take ATTIC and WATCHDIR from environment
It is better to define these variables in .gitolite.rc file than to
hardcode it in this script.
adc/trash | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/adc/trash b/adc/trash
index 596ca37..0c7a91f 100755
--- a/adc/trash
+++ b/adc/trash
@@ -2,14 +2,17 @@
. $(dirname $0)/adc.common-functions
+[ -n "$ATTIC" ] || die "Error: ATTIC not set"
+[ -d "$ATTIC" ] || mkdir $ATTIC
+[ -n "$WATCHDIR" ] || die 'Error: WATCHDIR not set'
+[ -d "$WATCHDIR" ] || die "Error: $WATCHDIR does not exist"
+
[ -z "$1" ] && die 'Error: Need a repo name'
get_rights_and_owner gitolite-admin
[ -z "$perm_write" ] && die "Error: You do not have permission to remove repositories"
-ATTIC=$HOME/Attic
ATTIC_SUFFIX=`date +%Y-%m-%d_%H:%M:%S`
-WATCHDIR=$HOME/watchdir
EMPTYSHA1='0000000000000000000000000000000000000000'
repo=$1
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5
More information about the pld-cvs-commit
mailing list