Merge branch 'local_config' of https://github.com/okbreathe/gollum into okbreathe-local_config
This commit is contained in:
+10
@@ -35,6 +35,10 @@ opts = OptionParser.new do |opts|
|
|||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.on("--config [CONFIG]", "Path to additional configuration file") do |config|
|
||||||
|
options['config'] = config
|
||||||
|
end
|
||||||
|
|
||||||
opts.on("--irb", "Start an irb process with gollum loaded for the current wiki.") do
|
opts.on("--irb", "Start an irb process with gollum loaded for the current wiki.") do
|
||||||
options['irb'] = true
|
options['irb'] = true
|
||||||
end
|
end
|
||||||
@@ -99,5 +103,11 @@ if options['irb']
|
|||||||
else
|
else
|
||||||
require 'gollum/frontend/app'
|
require 'gollum/frontend/app'
|
||||||
Precious::App.set(:gollum_path, gollum_path)
|
Precious::App.set(:gollum_path, gollum_path)
|
||||||
|
if cfg = options['config']
|
||||||
|
# If the path begins with a '/' it will be considered an absolute path,
|
||||||
|
# otherwise it will be relative to the CWD
|
||||||
|
cfg = File.join(Dir.getwd, cfg) unless cfg.slice(0) == File::SEPARATOR
|
||||||
|
require cfg
|
||||||
|
end
|
||||||
Precious::App.run!(options)
|
Precious::App.run!(options)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user