Skip to content
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

sfdx force:source:retrieve does not respect custom file path (not main/default) #238

Closed
pkozuchowski opened this issue Nov 14, 2019 · 5 comments
Labels
bug Issue or pull request that identifies or fixes a bug

Comments

@pkozuchowski
Copy link

Summary

When sfdx force:source:retrieve -p pathToFile is issued against file that is not in the main/default folder, the command will create a new file in main/default folder instead of overwriting existing file.
This is against documentation which says:
The source you retrieve overwrites the corresponding source files in your local project.

Steps To Reproduce:

  1. Create folder structure similar to this:
    ./force-app/commons/classes/ClassA.class
    ./force-app/main/default/ClassB.class

  2. Issue command sfdx force:source:retrieve -p ./force-app/commons/core/classes/apex/ClassA.cls

Expected result

File in /commons/classes should be overwritten:
./force-app/commons/classes/ClassA.class [updated from sandbox]
./force-app/main/default/ClassB.class

Actual result

New file is created:
./force-app/commons/classes/ClassA.class
./force-app/main/default/ClassA.class
./force-app/main/default/ClassB.class

SFDX CLI Version(to find the version of the CLI engine run sfdx --version):
sfdx-cli/7.32.0-b30e0302f0 win32-x64 node-v10.15.3

SFDX plugin Version(to find the version of the CLI plugin run sfdx plugins --core)

OS and version:
Windows 10.0.18362

@clairebianchi clairebianchi added the bug Issue or pull request that identifies or fixes a bug label Nov 15, 2019
@ChuckJonas
Copy link

Same as #97 & #45

@jvolkov
Copy link

jvolkov commented Nov 16, 2020

Experiencing this same issue seemingly out of no where since last week.

Is there a workaround?

@shetzel
Copy link
Contributor

shetzel commented Nov 16, 2020

@jvolkov - this is a very old issue that was fixed as part of the MPD (multiple package directory) phase 2 work. I don't know what versions of the CLI or plugins you're using, what OS, or if you have multiple package directories defined in your sfdx-project.json. I'm going to close this issue because I cannot reproduce it as specified in the repro steps with the latest CLI and plugins. If you have other steps that reproduce the problem you're seeing, please open a new issue with the repro steps, cli version, plugin versions, and OS.

@shetzel shetzel closed this as completed Nov 16, 2020
@jvolkov
Copy link

jvolkov commented Nov 16, 2020

@shetzel Thanks for the response. I opened issue #2471 detailing my specific problems with details.

@shetzel
Copy link
Contributor

shetzel commented Nov 17, 2020

@jvolkov Perfect, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue or pull request that identifies or fixes a bug
Projects
None yet
Development

No branches or pull requests

5 participants