Fixes issue #100 : README conflicts

This commit is contained in:
Anthony Scemama 2015-11-07 11:17:07 +01:00
parent 8b5ad98793
commit 640170a8b6
4 changed files with 33 additions and 1 deletions

View File

@ -13,7 +13,6 @@ then
fi
source ${QP_ROOT}/scripts/qp_include.sh
function do_gitingore()
{
cat << EOF > .gitignore

View File

@ -180,6 +180,11 @@ class ModuleHandler():
def create_png(self, l_module):
"""Create the png of the dependency tree for a l_module"""
# Don't update if we are not in the main repository
from is_master_repository import is_master_repository
if not is_master_repository:
return
basename = "tree_dependency"
path = '{0}.png'.format(basename)
@ -289,6 +294,12 @@ if __name__ == '__main__':
pass
if arguments["create_git_ignore"]:
# Don't update if we are not in the main repository
from is_master_repository import is_master_repository
if not is_master_repository:
sys.exit()
path = os.path.join(module_abs, ".gitignore")
with open(path, "w+") as f:

View File

@ -168,7 +168,15 @@ def update_documentation(d_readmen, root_module):
d_readme[path]["documentation"] = "\n".join(l_doc_section)
if __name__ == '__main__':
# Update documentation only if the remote repository is
# the main repository
from is_master_repository import is_master_repository
if not is_master_repository:
sys.exit(0)
arguments = docopt(__doc__)
if arguments["--root_module"]:

View File

@ -0,0 +1,14 @@
#!/usr/bin/env python
import subprocess
pipe = subprocess.Popen("git config --local --get remote.origin.url", \
shell=True, stdout=subprocess.PIPE)
result = pipe.stdout.read()
is_master_repository = "LCPQ/quantum_package" in result
if __name__ == "__main__":
import sys
if is_master_repository:
sys.exit(0)
else:
sys.exit(-1)