vscode-rsync icon indicating copy to clipboard operation
vscode-rsync copied to clipboard

rsync just deleted half of my files

Open jpastuszek opened this issue 6 years ago • 4 comments

I had Delete option checked in User settings and empty Remote so I can set it up per Workspace. I run Rsync on unconfigured workspace (empty Remote) and got this command running:

> rsync -rlptzv --progress --delete --exclude=.git --exclude=.vscode --exclude=target /Users/xxx/Documents/myproject/ / 

Guess what happened... luckily Mac has Time Machine...

Can you make sure Rsync does not run when Remote is empty and perhaps double check it is not running against /, please.

jpastuszek avatar Aug 15 '19 15:08 jpastuszek

It should thow an error about remote not being set. Can you post you settings. Thanks.

thisboyiscrazy avatar Nov 01 '19 15:11 thisboyiscrazy

Can we get a bump on this issue, its pretty critical. I just destroyed my laptop thanks to this bug.

jgreat avatar Nov 26 '21 20:11 jgreat

Settings were something like:

"sync-rsync.sites": [
  {
    "remotePath": ""
  }
],
"sync-rsync.delete": true,
"sync-rsync.onSave": true

OS: Ubuntu 21.04 vscode: 1.62 (ish)

jgreat avatar Nov 26 '21 20:11 jgreat

https://github.com/thisboyiscrazy/vscode-rsync/blob/90ae7c488fa2a478cc385a5619fe4eba847dbbe7/src/Config.ts#L126

Is the culprit. Since "" does not equal null, you're defaulting to /. :cry:

jgreat avatar Nov 27 '21 19:11 jgreat