lib/memo/cli/command/preview.rb in ememo-0.1.4 vs lib/memo/cli/command/preview.rb in ememo-0.1.5
- old
+ new
@@ -13,20 +13,26 @@
@defaultfile = Memo::File.new
end
def call
filename = @options[0]
+
path = case filename
when "today", "t"
@today.fullpath
else
Memo::File.new(
filename,
@options.namespace,
).fullpath
end
- @os.exec "#{@config.preview} #{@config.root}/#{path}"
+ cmd ="#{@config.preview} #{@config.root}/#{path}"
+ if @options.copy?
+ @os.exec "#{cmd} | (#{@config.pbcopy})"
+ end
+
+ @os.exec cmd
end
end
end
end
end