From d2a0dcbc681948219391aa507742347756475905 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 7 Apr 2013 22:18:03 -0400 Subject: v4: zap, delete output files, based on given (existing) source file name --- lib/sisu/v4/zap.rb | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'lib/sisu/v4/zap.rb') diff --git a/lib/sisu/v4/zap.rb b/lib/sisu/v4/zap.rb index fbda244f..42f41fb7 100644 --- a/lib/sisu/v4/zap.rb +++ b/lib/sisu/v4/zap.rb @@ -66,20 +66,23 @@ module SiSU_Zap class Source def initialize(opt) @opt=opt - @env=SiSU_Env::InfoEnv.new(@opt.fns) - @zap_path="#{@env.path.output}/#{@env.fnb}" - @zap=SiSU_Env::CleanOutput.new(@opt) + @env=SiSU_Env::InfoEnv.new(opt.fns) end def read + zap_path="#{@env.path.output}/#{@env.fnb}" + z=SiSU_Env::CleanOutput.new(@opt) if SiSU_Env::InfoSettings.new.permission?('zap') - tell=SiSU_Screen::Ansi.new(@opt.cmd,"Clean files related to processing #{@opt.cmd} ->","#{@opt.fns} -> #{@zap_path}") - @zap.zap.main_output - @zap.zap.site_map - @zap.zap.epub - @zap.zap.src - else tell=SiSU_Screen::Ansi.new(@opt.cmd,'use of -Z (zap) has not enabled in sisurc.yml') + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,"Clean files related to processing #{@opt.cmd} ->","#{@opt.fns} -> #{zap_path}") + tell.warn + end + z.zap.remove_output + else + unless @opt.cmd =~/q/ + tell=SiSU_Screen::Ansi.new(@opt.cmd,'use of -Z (zap) has not enabled in sisurc.yml') + tell.warn + end end - tell.warn unless @opt.cmd =~/q/ end end end -- cgit v1.2.3