Skip to content

Commit

Permalink
@ teracyhq#277 | add pre/postload extension implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
hoatle committed Jul 19, 2018
1 parent 97428dc commit cc89937
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ require_version(settings['teracy-dev']['require_version'])


# preload-ext list here
preload_ext_paths = settings["vagrant"]["preload_extension_paths"] ||= []


preload_ext_paths.each do |path|
load_file_path(path)
end


Vagrant.configure("2") do |config|
settings["nodes"].each do |node_config|
Expand All @@ -45,4 +52,8 @@ Vagrant.configure("2") do |config|
end
end
# postload-ext list here
postload_ext_paths = settings["vagrant"]["postload_extension_paths"] ||= []
postload_ext_paths.each do |path|
load_file_path(path)
end
end
11 changes: 11 additions & 0 deletions lib/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,14 @@ def get_logger()
return logger
end


def load_file_path(file_path)
begin
if File.file?(file_path)
load path
end
rescue Exception => msg
$logger.error(msg)
end
end

0 comments on commit cc89937

Please sign in to comment.