yongkangchen / remote-sync

Upload your files to remote host after every change. Both SCP/SFTP and FTP are supported.
https://atom.io/packages/remote-sync
MIT License
237 stars 71 forks source link

Watch wildcards #279

Open skyrpex opened 8 years ago

skyrpex commented 8 years ago

Is this a planned feature? I'd love to add some wildcards to my watch settings. For example:

{
  "...": {},
  "watch": [
    "/public/assets/**/*"
  ]
}

Regards!

elistone commented 8 years ago

Thank you for your feedback, we can look into implementing this into a future release.

tsunammis commented 8 years ago

I'm also interested by this feature 👍

rickmed commented 8 years ago

+1

thorleifjacobsen commented 8 years ago

+1 should also be able to watch a folder. Wildcards should fix that but i would love to syncronise my local /dist/ with my remote /v2/

ColonelBundy commented 8 years ago

+1 Please make this happen

elistone commented 8 years ago

I shall try and look at implementing this some time this week.

ColonelBundy commented 8 years ago

@elistone That would be wonderful, thank you!

ColonelBundy commented 8 years ago

@elistone Any updates on this? I'd love to get this asap.

elistone commented 8 years ago

@makkesk8 I'm working on this over the weekend, hopefully ready for testing early next week.

elistone commented 8 years ago

I have a version ready for anyone who's willing to help test, if you install remote-sync manually via clone and checkout v4.2.0-wip this branch contains methods that enable "Watch wildcards" as well as right click to watch folder.

Currently the watch wildcards methods do not apply styles this is still being worked on (kinda tricky) but the actually method of watching via wildcards seems to be working well with my little tests. Because of this the only method of checking which files are being monitored is use the Remote sync: Monitor Files List command which can be found using cmd+shift+P | ctrl+shift+P

Let me know of any issues / improvements.

For anyone willing to test but unsure how to install manually follow these steps see remote-sync readme (you will need to remove the current version first)

TitanNano commented 8 years ago

works well, but watching an entire project tree sends atoms CPU usage up to 130% on OSX. (several 1000 files)

TitanNano commented 8 years ago

if a file is deleted or added to the monitored folder the change is not detected. I tried "/dist/" and "/dist/**"

elistone commented 8 years ago

@TitanNano I don't think the module used to watch files was designed to watch every single file in a project which is probably why you are seeing very high CPU usage. As for monitoring deleting of files this has not yet been implemented meaning two things:

  1. When you delete a file/folder it is not deleted from the server
  2. It's possible the delete file or folder is still being monitored.
TitanNano commented 8 years ago

@elistone how about adding a file to the directory? Those also don't get uploaded.

elistone commented 8 years ago

@tamcap yeh at the moment all that is monitored is the changing of content e.g. updating text and hitting save no delete or add.

But these are great points I never really thought about them as it is not something I personal ever need to do but could be easy to implement.

TitanNano commented 8 years ago

@elistone I fixed the issues I mentioned. I will create a PR to your branch later. For the CPU impact, could you try to use fb-watchman if available? It's way more efficient. you could use the current package as a fallback if the user didn't install the watchman service.

lennox02 commented 8 years ago

@elistone I'm looking forward to this feature since my dev environment is tied to a server, and whenever I checkout a branch I either have to reupload my entire repo, or login to the server and do a checkout from there. Is there an eta for when this feature will be merged to master and officially released?

elistone commented 8 years ago

@lennox02 at the moment I very busy with work so have very little spare time in the evening, I cannot give any estimate, sorry.

KayahanKahriman commented 8 years ago

+1 this feature would be really so cool.

creategui commented 8 years ago

for those of you waiting for this feature this is what I do when I re-sync from source control: rsync -av --exclude '.DS_Store' --exclude '.tags' --exclude '.remote-sync.json' /my/local/source/path -e ssh user@remote.machine:/destination/path I have that in an sh file in my ~/bin.
You may want to add additional --exclude statements.
Also if you are using a different port other than 22 you will need to change the ssh to "ssh -p ". Make sure to include the quotes. It should be simple to make a generic script to parse the .remote-sync.json file but I've been too lazy to do that.


edit 9/9/16. I decided to write up a script today that reads in the .remote-sync.json file. Only works for scp transports. You can find it here: https://gist.github.com/creategui/cf105cf778922b2b1b1d32f8b91eb040

entozoon commented 7 years ago

+1 would be fantastic :)

simsanderson commented 7 years ago

+1 this would be great! Any ETA yet? Wish I had the programming skills to help you.

aminta commented 7 years ago

+1 here also!