I am trying to make PhpStorm run vagrant rsync when files are changed, because built-in rsync-auto fails with my deep directory structure. I am able to setup watcher in PhpStorm settings, but I don't know how to run it correctly. There problem is that when I run vagrant up or vagrant rsync from windows command line, I am getting different errors from wrong path to arguments issues, so I decided to run it under cygwin and it works now. So, I need a solution to run cygwin from command line and execute command in it.
What I tried:
C:/cygwin/bin/bash vagrant rsync Getting error:
C:\Program Files\Vagrant\embedded\bin\ruby.exe: No such file or directory -- /cygdrive/c/Program Files/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.5/lib/vagrant/pre-rubygems.rb (LoadError) Tried:
bash vagrant rsync Error:
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [Receive r=3.0.9] rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: error in rsync protocol data stream (code 12) at io.c(235) [sender= 3.1.1pre1] Trying to find out why output is different:
C:\>where bash C:\Program Files\Git\bin\bash.exe So msysgit is used in second case.
Command:
C:\cygwin\bin\mintty -e vagrant sync Output: nothing. Window opens and closes immediately.
2 Answers
Use c:\cygwin\bin\run.exe to launch cygwin processes from windows cmd.exe
1Use the bash command with the --login & -c options to launch Cygwin processes from Windows and see the output.
ie. C:\\cygwin64\\bin\\bash --login -c 'whoami'