lib/docman/builders/builder.rb in docman-0.0.46 vs lib/docman/builders/builder.rb in docman-0.0.47
- old
+ new
@@ -22,11 +22,21 @@
def config
super
@version = nil
environment = Application.instance.environment(@context.environment_name)
+
clean_changed = environment['clean_changed'].nil? ? true : environment['clean_changed']
add_action('before_execute', {'type' => :clean_changed}, @context) if clean_changed
+
+ info_file = File.join(@context['full_build_path'], 'info.yaml')
+ info = YAML::load_file(info_file) if File.file? info_file
+ if info
+ name = @context['name']
+ environment['previous'] = {}
+ environment['previous'][name] = info
+ end
+
end
def validate_command
raise "Please provide 'context'" if @context.nil?
raise "Context should be of type 'Info'" unless @context.is_a? Docman::Info