Skip to content

Commit

Permalink
fix package.xml combine bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsender committed Apr 22, 2015
1 parent 8adb261 commit 11b6c72
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import json
import pprint
import time
import xml

from . import requests
from . import processor
Expand Down Expand Up @@ -564,7 +565,7 @@ def __init__(self, *args, **kwargs):
super(CombinePackageXml, self).__init__(*args, **kwargs)

def run(self, dirs):
settings = context.get_settings()
self.settings = context.get_settings()

all_types = {}
for _dir in dirs:
Expand All @@ -585,7 +586,18 @@ def run(self, dirs):
{"ApexTrigger": ["test"]}
]
"""
_types = util.build_package_types(content)
try:
_types = util.build_package_types(content)
except xml.parsers.expat.ExpatError as ee:
message = "%s parse error: %s" % (package_xml, str(ee))
Printer.get("error").write(message)
if not sublime.ok_cancel_dialog(message, "Skip?"): return
continue
except KeyError as ex:
if self.settings["debug_mode"]:
print ("%s is not valid package.xml" % package_xml)
continue

for _type in _types:
members = _types[_type]

Expand All @@ -612,7 +624,7 @@ def run(self, dirs):
</Package>
""".format(
metadata_objects="".join(metadata_objects),
api_version=settings["api_version"]
api_version=self.settings["api_version"]
)

package_path = os.path.join(dirs[0], "combined package.xml")
Expand Down

0 comments on commit 11b6c72

Please sign in to comment.