Skip to content

Remove trailing slash from source path before extracting from archive #1420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,12 @@ def __extract_source_path_from_archive(self, source_path, model_type, model_name
:param model_name: the element name (my-app, etc.), used for logging
"""
_method_name = '__extract_source_path_from_archive'
# source path may be may be a single file (jar, war, etc.)

# model may have trailing slash on exploded source path
if source_path.endswith('/'):
source_path = source_path[:-1]

# source path may be a single file (jar, war, etc.)
if self.archive_helper.contains_file(source_path):
if is_remote:
self.archive_helper.extract_file(source_path, upload_remote_directory, False)
Expand Down Expand Up @@ -1307,7 +1312,7 @@ def _fix_plan_file(self, plan_dir, plan_path):
plan_file_name = 'plan.xml'
if plan_path is not None and len(str_helper.to_string(plan_path)) > 0:
plan_file_name = plan_path

plan_file = os.path.join(self.model_context.get_domain_home(), plan_dir, plan_file_name)
dbf = DocumentBuilderFactory.newInstance()
db = dbf.newDocumentBuilder()
Expand Down