Commit 58214710 authored by charlie-ablett's avatar charlie-ablett
Browse files

Use popen3 instead of popen2e, pipe output to notes

parent 05f9a7dd
GIT
remote: git@gitlab.coko.foundation:INK/ink-step.git
revision: 3b5cdc06d93ef5814cf29e39a1fd491f58c69ddb
revision: cb8ad965047889c3b7cff2919c59a3c04d9ef7e1
specs:
ink_step (0.1.10)
ink_step (0.1.11)
awesome_print
httparty
rubyzip
......@@ -10,7 +10,7 @@ GIT
PATH
remote: .
specs:
inkstep_coko_conversion (0.2.8)
inkstep_coko_conversion (0.2.9)
GEM
remote: https://rubygems.org/
......
......@@ -20,14 +20,15 @@ module Utilities
# java -jar Saxon-HE-9.7.0-4.jar -s:some_file.docx -xsl:xsl_file_path.xsl -o:conversion_output.html
log_as_step "Applying xsl..."
command = "java -jar #{saxon_jar_path} -s:#{@original_file_path} -xsl:#{xsl_file_path} -o:#{output_file_path}"
command = "java -jar #{Shellwords.escape(saxon_jar_path)} -s:#{Shellwords.escape(@original_file_path)} -xsl:#{Shellwords.escape(xsl_file_path)} -o:#{Shellwords.escape(output_file_path)}"
log_as_step "Running command '#{command}'"
Open3.popen2e(command) do |stdin, stdout_err, wait_thr|
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
exit_status = wait_thr.value
@success = exit_status.success?
@notes << stdout.read
unless @success
err = stdout_err.read
err = stderr.read
log_as_step "err: #{err}"
@errors << err
end
......
module CokoConversion
VERSION = '0.2.8'
VERSION = '0.2.9'
end
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment