Hi all,
I need a small advise on github for Sketchup extension.
How you manage your extension on github?
I use github for RoR where I push an entire project folder but for Sketchup extension I push folder and main file manually.
What’s your best way push it ?
tt_su
October 21, 2015, 3:51pm
2
Do you mean push changes to the Git repo - or how to load the extension from the repo into Sketchup?
I keep all my extensions in Git/Mercurial - and I have a folder where each project is. I then have a file in the Plugins folder which adds the path to each extension to $LOAD_PATH
and then require
it.
I’n not sure if that answered your question…?
1 Like
hi Tomthom,
That exactly what i’m looking for !
Thanks a lot
tt_su
October 22, 2015, 11:43am
4
Just as an example - this is one of my loader-scripts:
SOURCE = File.join(ENV["HOME"], "SourceTree").freeze
# Load platform neutral extensions.
paths = [
"#{SOURCE}/testup-2/src",
"#{SOURCE}/speedup/src",
"#{SOURCE}/sketchup-stl/src",
"#{SOURCE}/sketchup-shapes/src",
"#{SOURCE}/SelectionTools/src",
"#{SOURCE}/sketchup-attribute-helper/src",
"#{SOURCE}/sketchup-diagnostics/src",
"#{SOURCE}/sketchup-safe-frames/src",
"#{SOURCE}/Classifier Properties/src",
"#{SOURCE}/Template Translation",
"#{SOURCE}/TemplateUpdater",
"#{SOURCE}/SKUI/src",
"#{SOURCE}/cleanup",
"#{SOURCE}/bezier-surface/src",
"#{SOURCE}/solid-inspector/src",
"#{SOURCE}/quadface-tools/src",
"#{SOURCE}/sketchup-ew-review/src",
"#{SOURCE}/Argus/src",
"#{SOURCE}/error-reporter-client/src",
"#{SOURCE}/error-reporter-client/examples"
]
# Load all Ruby files in the external paths.
paths.each { |path|
$LOAD_PATH << path
Dir.glob("#{path}/*.{rb,rbs}").each { |file|
begin
Sketchup.require(file)
rescue LoadError => error
p error
puts "\tfrom #{error.backtrace.join("\n\tfrom ")}"
end
}
}
I use Atlassins SourceTree to manage my git repos - so whenever I setup a new one I need to use I just add another line to the loader script.
1 Like
Thanks Tomthom.
i finaly make a script that copy and push extension. I feel more confortable with it.
Hi all
I’m just starting to experimenting with Git and will therefore restructure my plugin directories.
Thomthom: I’m a little curious why you manually define an array of paths. Has it any advantages over Dir.glob(“#{SOURCE}//src/ .{rb,rbs}”) ?