mirror of
https://github.com/seejohnrun/haste-client.git
synced 2025-12-15 16:25:57 +00:00
@@ -11,8 +11,9 @@ module Haste
|
|||||||
# Pull all of the data from STDIN
|
# Pull all of the data from STDIN
|
||||||
def initialize
|
def initialize
|
||||||
if STDIN.tty?
|
if STDIN.tty?
|
||||||
abort 'No input file given' unless ARGV.length == 1
|
file = ARGV.first
|
||||||
abort "#{file}: No such path" unless File.exists?(file = ARGV[0])
|
abort 'No input file given' unless file
|
||||||
|
abort "#{file}: No such path" unless File.exists?(file)
|
||||||
@input = open(file).read
|
@input = open(file).read
|
||||||
else
|
else
|
||||||
@input = STDIN.readlines.join
|
@input = STDIN.readlines.join
|
||||||
|
|||||||
Reference in New Issue
Block a user