lib/modulesync.rb in modulesync-0.3.0 vs lib/modulesync.rb in modulesync-0.4.0

- old
+ new

@@ -57,13 +57,15 @@ managed_modules.each do |puppet_module, opts| puts "Syncing #{puppet_module}" git_base = "#{options[:git_base]}#{options[:namespace]}" Git.pull(git_base, puppet_module, options[:branch], opts || {}) module_configs = Util.parse_config("#{PROJ_ROOT}/#{puppet_module}/#{MODULE_CONF_FILE}") - files_to_manage = module_files | defaults.keys | module_configs.keys + global_defaults = defaults[GLOBAL_DEFAULTS_KEY] || {} + module_defaults = module_configs[GLOBAL_DEFAULTS_KEY] || {} + files_to_manage = (module_files | defaults.keys | module_configs.keys) - [GLOBAL_DEFAULTS_KEY] files_to_delete = [] files_to_manage.each do |file| - file_configs = (defaults[file] || {}).merge(module_configs[file] || {}) + file_configs = global_defaults.merge(defaults[file] || {}).merge(module_defaults).merge(module_configs[file] || {}) file_configs[:puppet_module] = puppet_module if file_configs['unmanaged'] puts "Not managing #{file} in #{puppet_module}" files_to_delete << file elsif file_configs['delete']