[projects/git-slug: 117/170] Read watchdir from environment

glen glen at pld-linux.org
Mon Sep 21 21:48:38 CEST 2015


commit b487f67fbc1471f8724b7f5e14583cb9574700f9
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Mon Jun 25 10:12:35 2012 +0100

    Read watchdir from environment

 post-receive.python.d/slug_hook.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/post-receive.python.d/slug_hook.py b/post-receive.python.d/slug_hook.py
index fc49c04..1d9540a 100644
--- a/post-receive.python.d/slug_hook.py
+++ b/post-receive.python.d/slug_hook.py
@@ -1,11 +1,11 @@
 import os
 import tempfile
 
-from git_slug.serverconst import WATCHDIR
-
 
 def run(data):
-    global WATCHDIR
+    WATCHDIR = os.getenv('WATCHDIR')
+    if WATCHDIR is None:
+        print('Envrionment variable WATCHDIR not defined', file=sys.stderr)
     WATCHDIR = os.path.join(os.path.expanduser('~'), WATCHDIR)
     gitrepo = os.environ.get('GL_REPO')
     if gitrepo.startswith('packages/'):
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list