There was an error while loading. Please reload this page.
1 parent 0981fbb commit 42d99faCopy full SHA for 42d99fa
lib/gist.rb
@@ -71,7 +71,7 @@ def execute(*args)
71
opts.parse!(args)
72
73
begin
74
- if $stdin.tty?
+ if $stdin.tty? && args[0] != '-'
75
# Run without stdin.
76
77
# No args, print help.
@@ -80,10 +80,8 @@ def execute(*args)
80
exit
81
end
82
83
- if args[0] == '-'
84
- input = $stdin.read
85
# Check if arg is a file. If so, grab the content.
86
- elsif File.exists?(file = args[0])
+ if File.exists?(file = args[0])
87
input = File.read(file)
88
gist_filename = file
89
gist_extension = File.extname(file) if file.include?('.')
0 commit comments