This one is a simple and handy trick when you want to copy your directories without node_modules folder.
Enter this command in your terminal.
robocopy SOURCE DEST /mir /xd node_modules
@Itzikil this code copy / paste files, there is no deletion involved.
you must have done something else
robocopy /mir. Very powerful switch that can do a lot of good, but just be aware of what that switch does before you go using it. It will sync two dirs, including deleting items if they don't exist in the source dir.
So copy it in a new folder, or use another command that does not sync content.
is it possible that this code delete my files instead of coping??
Yes. The /MIR switch is equivalent to /e /purge which does delete files in certain cases. See https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy for full details.
Hi!
For OSX (and i guess other unix)
rsync -av -progress --exclude="node_modules" sourceToCopy destination
Excellent, thanks
I dont want to delete
I tried to copy some folders, but it deleted a lot of files from my computer;/