Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
update to work with cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Oct 27, 2016
1 parent 78932ec commit 80c1633
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/inkscape_merge/processor.rb
Expand Up @@ -105,7 +105,22 @@ def validate_options

# Run Inkscape to generate files
def ink_generate(in_file, out_file, format='pdf', dpi="300")
cmd = %(#{@options.inkscape} --without-gui --export-#{format}=#{out_file} --export-dpi=#{dpi} #{in_file})

new_in_file = case RUBY_PLATFORM
when /cygwin/
Shellwords.escape(`cygpath.exe #{in_file} -w`.strip)
else
in_file
end

new_out_file = case RUBY_PLATFORM
when /cygwin/
Shellwords.escape(`cygpath.exe #{out_file} -w`.strip)
else
out_file
end

cmd = %(#{Shellwords.escape(@options.inkscape)} --without-gui --export-dpi=#{dpi} --export-#{format}=#{new_out_file} #{new_in_file})
puts "INKSCAPE CMD: #{cmd}" if @options.verbose
ink_error = `#{cmd} 2>&1`
unless $?.success?
Expand Down

0 comments on commit 80c1633

Please sign in to comment.