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

ApexRefreshProject doesn't remove local files that don't exist on remote #70

Open
kgrzywacz opened this issue Oct 17, 2016 · 3 comments

Comments

@kgrzywacz
Copy link
Contributor

kgrzywacz commented Oct 17, 2016

Same as title, while in documentation we have the following:
Refresh current project and download new/modified files from SFDC, replacing all local files.

Which for me indicated that all local files will be removed, and new files will be downloaded. Is current behaviour intended?

@kgrzywacz kgrzywacz changed the title ApexRefreshProject doesn't remove files that don ApexRefreshProject doesn't remove files that don't exist on remote from local Oct 17, 2016
@kgrzywacz kgrzywacz changed the title ApexRefreshProject doesn't remove files that don't exist on remote from local ApexRefreshProject doesn't remove local files that don't exist on remote Oct 17, 2016
@neowit
Copy link
Owner

neowit commented Oct 18, 2016

Hello @kgrzywacz

Which for me indicated that all local files will be removed

No, this is not the case.
Refresh is not supposed to remove files proactively. It does exactly what you quoted - replaces local files, but if no replacement file received from SFDC then local file stays intact.

Perhaps documentation needs to be updated to clarify this... If you have suggestions on alternative wording please let me know.

@kgrzywacz
Copy link
Contributor Author

Hello @neowit,

I think my assumption was wrong. I'm just used to different behaviour for similar commands.

Would it be possible to add new command - ApexCleanProject that would clean all local files in working directory, and then pull metadata from SFDC?

@neowit
Copy link
Owner

neowit commented Dec 22, 2016

I am not sure about this.
The problem is how to determine which files are to be cleaned and which ones are to be kept.
Indiscriminate removal of all files in "src" folder may not be what most people want.
Besides - vim plugin does not know much about which files are actually salesforce files and which ones are not.

I think a much better/simpler option would be if you wrote your own shell or vim script which removes what you need.
For example - to remove all files in src folder, but keep package.xml and directory structure:

find src/ -type f -not -name 'package.xml' -print0 | xargs -0 rm --

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants