lib/docman/builders/builder.rb in docman-0.0.13 vs lib/docman/builders/builder.rb in docman-0.0.14
- old
+ new
@@ -30,19 +30,27 @@
raise "Context should be of type 'Info'" unless @context.is_a? Docman::Info
end
before_execute do
if @context.need_rebuild?
- log("Need rebuild")
+ @context.build_mode = :rebuild
else
- log("Rebuild not needed")
- raise NoChangesError, 'This version already deployed' unless changed?
+ if @context.changed? or changed?
+ @context.build_mode = :update
+ log("Changed")
+ else
+ log("Not changed")
+ @context.build_mode = :none
+ raise NoChangesError, 'This version already deployed'
+ end
end
end
after_execute do
- @execute_result = @context.write_info(@execute_result)
+ if @execute_result
+ @execute_result = @context.write_info(@execute_result)
+ end
end
def changed?
false
end