commit 22f1cc08166a164e4f7892096096366819ee51da
parent 2dfd378b616243d03203e49f5ee29636051d3cbf
Author: Jonah <Jonah@GoodCoffee.ca>
Date: Wed, 28 Oct 2009 18:06:43 -0400
change opening attachments on darwin to use open instead of run-mailcap
MacOSX has a special command (open) for opening files - there is no support for
mailcap. This patch uses case to run the appropriate command depending on the
architecture used.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
@@ -132,7 +132,12 @@ EOS
def initial_state; :open end
def viewable?; @lines.nil? end
def view_default! path
- cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+ case Config::CONFIG['arch']
+ when /darwin/
+ cmd = "open '#{path}'"
+ else
+ cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+ end
debug "running: #{cmd.inspect}"
BufferManager.shell_out(cmd)
$? == 0