SketchUp/sketchup-developer-tools

Don't assume it's installed under Plugins folder

thomthom opened this issue · 7 comments

People, like me, like to install plugins in a different location, such as Dropbox in order to share plugins among multiple computers without having to install them on each one.

When plugins assume they are located under SketchUp's plugin folder by using find_support_file they cannot be installed elsewhere.

My recommendation for plugins to find their support file is to use the magic constant __FILE__ to derive the plugins folder from. File.dirname( __FILE__ )

Sounds reasonable to me.

Good, because right now I can't re-load the extensions right from their repos as I'd like to be able to.

Agreed, this would help a lot with my workflow as well. I use dropbox to sync projects between myself and the rest of my development team. Would be nice to access plugins in there.

So are folks manually copying/pasting files back and forth from Plugins to their repo?

I think I'll try to symlink the ext loader and folder in src/ in Plugins.

Here are the commands for making symbolic links in Windows. These are run as admin from your Plugins folder. The path to your repos is probably different than mine.

Linking the folder:
Plugins>mklink /d sketchup-developer-tools C:\Users\Jim\Documents\GitHub\sketchup-developer-tools\src\sketchup-developer-tools

and the file:
Plugins>mklink sketchup-developer-tools.rb C:\Users\Jim\Documents\GitHub\sketchup-developer-tools\src\sketchup-developer-tools.rb

At the moment I copy and past. Which is annoying. Once we get this repo to use __FILE__ and load from any location I'll modify my proxy loader script to load it.

Symbolic links are nice. If they are not the default links (like in Windows), there is an extension http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html