Skip to content

Commit e57c57e

Browse files
committed
Fixed so PATH modification doesnt error on windows
1 parent 126ebd3 commit e57c57e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/grim/image_magick_processor.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ def save(pdf, index, path, options)
4040
command << "#{Shellwords.shellescape(pdf.path)}[#{index}]"
4141
command << path
4242

43-
command.unshift("PATH=#{File.dirname(@ghostscript_path)}:#{ENV['PATH']}") if @ghostscript_path && @ghostscript_path != DefaultGhostScriptPath
43+
ENV['PATH'] = "#{File.dirname(@ghostscript_path)}#{File::PATH_SEPARATOR}#{ENV['PATH']}" if @ghostscript_path && @ghostscript_path != DefaultGhostScriptPath
4444

4545
result = `#{command.join(' ')}`
46-
46+
47+
ENV['PATH'] = @original_path if @ghostscript_path && @ghostscript_path != DefaultGhostScriptPath
48+
4749
$? == 0 || raise(UnprocessablePage, result)
4850
end
4951
end

0 commit comments

Comments
 (0)