lib/docman/commands/clean_changed_cmd.rb in docman-0.0.6 vs lib/docman/commands/clean_changed_cmd.rb in docman-0.0.7
- old
+ new
@@ -9,11 +9,17 @@
end
def execute
if File.directory? @context['full_build_path']
if @context.need_rebuild?
+ return false if @context['type'] == 'dir'
return false if @context['type'] == 'root' and @context['build_type'] == :dir_builder and not GitUtil.repo?(@context['full_build_path'])
return false if @context['type'] == 'root' and @context['build_type'] == :git_direct_builder and GitUtil.repo?(@context['full_build_path'])
+ if @context['type'] == 'repo'
+ if @context['build_type'] == :dir_direct_builder
+ return false if GitUtil.repo?(@context['full_build_path'])
+ end
+ end
log("Remove #{@context['full_build_path']}")
FileUtils.rm_rf @context['full_build_path']
end
end
end
\ No newline at end of file