From f8697fc66079d13e6bff46d300c287afeac9b5da Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 21 Jan 2016 09:50:39 +0100 Subject: [PATCH] auto detect repo root --- app/deploy/install_linux_sysvinit.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/deploy/install_linux_sysvinit.py b/app/deploy/install_linux_sysvinit.py index da6a0885..526a67c2 100755 --- a/app/deploy/install_linux_sysvinit.py +++ b/app/deploy/install_linux_sysvinit.py @@ -2,6 +2,19 @@ import os +path = os.getcwd() +vcss = ['git', 'svn', 'hg'] + +def is_repo_root(path): + content = os.listdir(path) + for vcs in vcss: + if '.' + vcs in content: + return True + return False + +while not is_repo_root(path): + path = os.sep.join(path.split(os.sep)[:-1]) + path = os.sep.join(os.getcwd().split(os.sep)[:-2]) name = path.split(os.sep)[-1].lower() conf = path + os.sep + 'docker-compose.yml' -- 2.39.5