getflywheel / local-addon-volumes

Mount additional directories for your sites in Local by Flywheel.
https://local.getflywheel.com
MIT License
114 stars 11 forks source link

Add option to automatically create symlink on host-side to improve experience in IDEs and other applications #1

Open claygriffiths opened 8 years ago

afragen commented 8 years ago

Background: a synced folder in Vagrant displays as an empty directory. While it works great for a working representation of your plugin or theme it does not allow for editing.

If, after creating the synced folder, a symlink is created in place of the synced folder, it is now possible to edit the plugin/theme in your IDE.

afragen commented 8 years ago

BTW, this exchange from synced folder to symlink must occur every time Pressmatic would normally run the Volumes add-on. So after a restart, volume remap, etc.

Each individual entry would need a checkbox to create a symlink.

The flow would likely be something like the following.

  1. Delete the symlink in the Container Destination
  2. Create/Re-create the synced folder from Host Source to Container Destination
  3. Delete the synced folder in Container Destination
  4. Create symlink from Host Source to Container Destination

Here's the code I used to use with VVV. I would have to run the shell script every time VVV reloaded, etc.

https://gist.github.com/afragen/549cc092a1f61c2a8d7c

Ipstenu commented 7 years ago

This is my biggest annoyance. I can symlink a folder, but it doesn't sync.

I'm using Local for development, and my workflow is now this:

1) Edit code 2) Run rsync script

Over and over :( It doesn't feel like it's a real symlink or an add-on volume so much as I can map a 'command'.

afragen commented 7 years ago

I believe I have a working solution. It obviously requires modification to suit your personal needs.

https://gist.github.com/afragen/748e4780b6057d4c41cf9e466557042a

After the plugins or themes are added via the Volumes Addon, simply run this modified script and symlinks with replace the created synced folders that LbF creates.

@Ipstenu no more rsync