diff options
Diffstat (limited to 'lib/sisu/current/git.rb')
-rw-r--r-- | lib/sisu/current/git.rb | 72 |
1 files changed, 53 insertions, 19 deletions
diff --git a/lib/sisu/current/git.rb b/lib/sisu/current/git.rb index 0ec3520b..b8b5f106 100644 --- a/lib/sisu/current/git.rb +++ b/lib/sisu/current/git.rb @@ -132,14 +132,22 @@ module SiSU_Git (found =~/bin\/git\b/) ? true : false end def make_dir_fnb - FileUtils::mkdir_p(@git_path[:fnb]) unless FileTest.directory?(@git_path[:fnb]) - FileUtils::mkdir_p(@git_path[:doc]) unless FileTest.directory?(@git_path[:doc]) - FileUtils::mkdir_p(@git_path[:po]) unless FileTest.directory?(@git_path[:po]) - FileUtils::mkdir_p(@git_path[:pot]) unless FileTest.directory?(@git_path[:pot]) - FileUtils::mkdir_p(@git_path[:conf]) unless FileTest.directory?(@git_path[:conf]) - FileUtils::mkdir_p(@git_path[:image]) unless FileTest.directory?(@git_path[:image]) - #FileUtils::mkdir_p(@git_path[:audio]) unless FileTest.directory?(@git_path[:audio]) - #FileUtils::mkdir_p(@git_path[:video]) unless FileTest.directory?(@git_path[:video]) + FileUtils::mkdir_p(@git_path[:fnb]) \ + unless FileTest.directory?(@git_path[:fnb]) + FileUtils::mkdir_p(@git_path[:doc]) \ + unless FileTest.directory?(@git_path[:doc]) + FileUtils::mkdir_p(@git_path[:po]) \ + unless FileTest.directory?(@git_path[:po]) + FileUtils::mkdir_p(@git_path[:pot]) \ + unless FileTest.directory?(@git_path[:pot]) + FileUtils::mkdir_p(@git_path[:conf]) \ + unless FileTest.directory?(@git_path[:conf]) + FileUtils::mkdir_p(@git_path[:image]) \ + unless FileTest.directory?(@git_path[:image]) + #FileUtils::mkdir_p(@git_path[:audio]) \ + # unless FileTest.directory?(@git_path[:audio]) + #FileUtils::mkdir_p(@git_path[:video]) \ + # unless FileTest.directory?(@git_path[:video]) end def git_init unless FileTest.directory?("#{@git_path[:fnb]}/.git") @@ -168,13 +176,23 @@ module SiSU_Git p __LINE__ end def copy_src_head - if @opt.f_pth[:lng] - FileUtils::cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}",@git_path[:doc]) + if @opt.f_pth[:lng] \ + and File.exist?("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}") + FileUtils::cp_r( + "#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{@opt.fns}", + @git_path[:doc] + ) elsif @opt.fns =~/\.ssm\.sst/ ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm') - FileUtils::cp_r("#{@env.path.pwd}/#{ssm}",@git_path[:doc]) - else - FileUtils::cp_r("#{@env.path.pwd}/#{@opt.fns}",@git_path[:doc]) + FileUtils::cp_r( + "#{@env.path.pwd}/#{ssm}", + @git_path[:doc] + ) + elsif File.exist?("#{@env.path.pwd}/#{@opt.fns}") + FileUtils::cp_r( + "#{@env.path.pwd}/#{@opt.fns}", + @git_path[:doc] + ) end end def copy_related_sst_ssi @@ -183,14 +201,21 @@ module SiSU_Git file_array=IO.readlines(@opt.fns,'') file_array.each do |f| if f =~@rgx_doc_import - doc_import = doc_import + f.scan(@rgx_doc_import).uniq.flatten + doc_import = doc_import \ + + f.scan(@rgx_doc_import).uniq.flatten end end doc_import.each do |f| if @opt.f_pth[:lng] - FileUtils::cp_r("#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{f}",@git_path[:doc]) + FileUtils::cp_r( + "#{@env.path.pwd}/#{@opt.f_pth[:lng]}/#{f}", + @git_path[:doc] + ) else - FileUtils::cp_r("#{@env.path.pwd}/#{f}",@git_path[:doc]) + FileUtils::cp_r( + "#{@env.path.pwd}/#{f}", + @git_path[:doc] + ) end end end @@ -200,10 +225,19 @@ module SiSU_Git and not @opt.act[:ao][:set]==:on ##SiSU_Assemble::Composite.new(@opt).read #SiSU_AO::Source.new(@opt).read # -m - "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" + @env.processing_path.composite_file \ + + '/' \ + + @opt.fnb \ + + '.ssm.sst' elsif composite_src - "#{@env.processing_path.composite_file}/#{@opt.fnb}.ssm.sst" - else "#{@env.path.pwd}/#{@opt.fns}" + @env.processing_path.composite_file \ + + '/' \ + + @opt.fnb \ + + '.ssm.sst' + else + @env.path.pwd + + '/' \ + + @opt.fns end end def read_composite |