Skip to content
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
33 changes: 17 additions & 16 deletions cumulusci/tasks/salesforce/sourcetracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def _reset_sfdx_snapshot(self):
retrieve_changes_task_options["output_dir"] = {
"description": (
"The output directory for the retrieved metadata. "
+ "If not specified, defaults to force-app or the target directory passed to retrieve changes."
+ "If set, this will be passed as the --output-dir option to 'sfdx project retrieve start'. "
+ "If not set, the default output directory will be used by Salesforce CLI (usually 'force-app')."
),
"required": False,
}
Expand Down Expand Up @@ -247,10 +248,8 @@ def retrieve_components(
to a namespace prefix to replace it with a `%%%NAMESPACE%%%` token.
"""

# Always use output_dir if specified, else use target
retrieve_target = (
os.path.realpath(output_dir) if output_dir else os.path.realpath(target)
)
# Resolve output_dir if provided; otherwise let sfdx choose defaults
retrieve_target = os.path.realpath(output_dir) if output_dir else None
profiles = []
# If retrieve_complete_profile and project_config is None, raise error
# This is because project_config is only required if retrieve_complete_profile is True
Expand Down Expand Up @@ -302,21 +301,23 @@ def retrieve_components(
_write_manifest(components, package_xml_path, api_version)

# Retrieve specified components in DX format
args = [
"-a",
str(api_version),
"-x",
os.path.join(package_xml_path, "package.xml"),
"-w",
"5",
"--ignore-conflicts",
]
if retrieve_target is not None:
args.extend(["--output-dir", retrieve_target])

p = sfdx(
"project retrieve start",
access_token=org_config.access_token,
log_note="Retrieving components",
args=[
"-a",
str(api_version),
"-x",
os.path.join(package_xml_path, "package.xml"),
"-w",
"5",
"--ignore-conflicts",
"--output-dir",
retrieve_target,
],
args=args,
capture_output=capture_output,
check_return=True,
env={"SF_ORG_INSTANCE_URL": org_config.instance_url},
Expand Down
Loading