aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/sisupod_make.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/sisupod_make.rb')
-rw-r--r--lib/sisu/v0/sisupod_make.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/sisu/v0/sisupod_make.rb b/lib/sisu/v0/sisupod_make.rb
index 8e6932f0..392aee7d 100644
--- a/lib/sisu/v0/sisupod_make.rb
+++ b/lib/sisu/v0/sisupod_make.rb
@@ -72,6 +72,10 @@ module SiSU_Doc
@v=if @opt.cmd =~/[VM]/; 'v'
else ''
end
+ @local_path="#{@env.path.output}/src" #@local_path="#{@env.path.output}/#{@env.fnb}"
+ @zipfile=if @opt.fns =~/\.ssm\.sst$/; @opt.fns.gsub(/(?:\~\S{2,3})?\.ssm\.sst$/,'.ssm')
+ else @opt.fns.gsub(/(?:\~\S{2,3})?(\.sst)$/,'\1')
+ end
File.mkpath(pod_path) unless FileTest.directory?(pod_path)
rm_rf("#{@env.path.processing}sisupod/*") if FileTest.directory?("#{@env.path.processing}sisupod")
end
@@ -79,7 +83,7 @@ module SiSU_Doc
tell=SiSU_Screen::Ansi.new(@opt.cmd,'Share SiSU Document (zip)',@opt.fns)
tell.green_hi_blue unless @opt.cmd =~/q/
unless @opt.fns.empty?
- tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns}.zip -> #{@env.path.output}/#{@opt.fnb}/sisupod.zip")
+ tell=SiSU_Screen::Ansi.new(@opt.cmd,'Make sisu document (zip) and place in output directory',"#{@opt.fns} -> file://#{@env.path.output}/src/#{@zipfile}.zip")
tell.warn unless @opt.cmd =~/q/
directories
sisupod_build
@@ -157,7 +161,7 @@ module SiSU_Doc
@rgx_image=/\{\s*(\S+?\.(?:png|jpg|gif))/
@rgx_skin=/^(?:@skin:|0~skin)\s+(\S+)/
@rgx_doc_import=/^%\s\s*\|(\S+?\.ss[ti])\|@\|\^\|>>ok/
- use_file=if @opt.fns =~/(?:\.ssm|\._sst)$/; "#{@env.path.composite_file}/#{@opt.fnb}._sst"
+ use_file=if @opt.fns =~/(?:\.ssm|\.ssm\.sst)$/; "#{@env.path.composite_file}/#{@opt.fnb}.ssm.sst"
else @opt.fns
end
file_array=IO.readlines(use_file,'')
@@ -166,7 +170,7 @@ module SiSU_Doc
if f !~/^%\s/
skin << f.scan(@rgx_skin).uniq.flatten if f =~@rgx_skin
images << f.scan(@rgx_image).uniq if f =~@rgx_image
- elsif f =~/^%\s/ and @opt.fns =~/\._sst$/
+ elsif f =~/^%\s/ and @opt.fns =~/\.ssm\.sst$/
doc_import << f.scan(@rgx_doc_import).uniq if f =~@rgx_doc_import
end
end
@@ -224,7 +228,7 @@ module SiSU_Doc
end
end
x=@env.document_language_versions_found #check multiple document language versions (param not used)
- if doc_import.flatten.length > 0 and @opt.fns =~/\._sst$/
+ if doc_import.flatten.length > 0 and @opt.fns =~/\.ssm\.sst$/
doc_import.flatten.each do |f|
cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")
end
@@ -233,42 +237,38 @@ module SiSU_Doc
x[:f].each do |f|
cp_r("#{@env.path.pwd}/#{f}","#{@env.path.processing}/sisupod/#{f}")
end
- elsif @opt.fns =~/\._sst/
- ssm=@opt.fns.gsub(/\._sst/,'.ssm')
+ elsif @opt.fns =~/\.ssm\.sst/
+ ssm=@opt.fns.gsub(/\.ssm\.sst/,'.ssm')
cp_r("#{@env.path.pwd}/#{ssm}","#{@env.path.processing}/sisupod/#{ssm}")
else cp_r("#{@env.path.pwd}/#{@opt.fns}","#{@env.path.processing}/sisupod/#{@opt.fns}")
end #NB not all possibilies met, revisit, also in case of composite file may wish to add README
end
def sisupod_7zip #look at later
- dir=SiSU_Env::Info_env.new(@opt.fns)
- local_path="#{dir.path.output}/#{dir.fnb}"
- File.mkpath(local_path) unless FileTest.directory?(local_path)
+ File.mkpath(@local_path) unless FileTest.directory?(@local_path)
system(%{
cd #{@env.path.processing}
echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt
#7zip -qz #{@opt.fns}.7z sisu_zip.txt < sisu_zip.txt
- 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@opt.fns}.7z sisu_zip.txt
- 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@opt.fns}.7z sisupod
- #7zip -qr #{@opt.fns}.7z sisupod
- mv #{@opt.fns}.7z #{local_path}/sisupod.7z &
+ 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisu_zip.txt
+ 7zr a -t7z -m0=lzma -mx=9 -ms=on #{@zipfile}.7z sisupod
+ #7zip -qr #{@zipfile}.7z sisupod
+ mv #{@zipfile}.7z #{@local_path}/. &
rm -r sisupod/* && cd #{@env.path.pwd}
})
tell=SiSU_Screen::Ansi.new('',"#{@opt.fns}.7z")
tell.blue_tab unless @opt.cmd =~/q/
end
def sisupod_zip
- dir=SiSU_Env::Info_env.new(@opt.fns)
- local_path="#{dir.path.output}/#{dir.fnb}"
- File.mkpath(local_path) unless FileTest.directory?(local_path)
+ File.mkpath(@local_path) unless FileTest.directory?(@local_path)
system(%{
cd #{@env.path.processing}
echo "SiSU sisupod #{@ver[:version]}" > sisu_zip.txt
- zip -qz #{@opt.fns}.zip sisu_zip.txt < sisu_zip.txt
- zip -qr #{@opt.fns}.zip sisupod
- mv #{@opt.fns}.zip #{local_path}/sisupod.zip &
+ zip -qz #{@zipfile}.zip sisu_zip.txt < sisu_zip.txt
+ zip -qr #{@zipfile}.zip sisupod
+ mv #{@zipfile}.zip #{@local_path}/. &
rm -r sisupod/* && cd #{@env.path.pwd}
})
- tell=SiSU_Screen::Ansi.new('',"#{@opt.fns}.zip")
+ tell=SiSU_Screen::Ansi.new('',"#{@zipfile}.zip")
tell.blue_tab unless @opt.cmd =~/q/
end
end