Unverified Commit 1a997dad authored by Oskar Roesler's avatar Oskar Roesler Committed by GitHub
Browse files

Merge pull request #6 from fmauch/subfolder_by_package_xml

Look into the package.xml files to find subfolders
parents 1cab9815 dcc3fd40
......@@ -4,7 +4,7 @@ import sys
import re
import subprocess
import urllib
import xml.etree.ElementTree as ET
class Update(Routines):
......@@ -100,8 +100,11 @@ class Update(Routines):
repo = self.gh.get_repo(repo_name)
contents = repo.get_contents(".")
for content in contents:
if self.package_info['orig_name'] in content.path and content.type == 'dir':
return content.path
if content.name == 'package.xml':
root = ET.fromstring(content.decoded_content)
name = root.find('name')
if name.text == self.package_info['orig_name']:
return os.path.dirname(content.path)
if content.type == 'dir':
contents.extend(repo.get_contents(content.path))
raise RuntimeError("Can't find nested path: " + self.package)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment