Skip to content

Commit d9668ff

Browse files
committed
Only append \n to URL if outputting to tty. Piping indicates URL only is probably wanted.
1 parent 94db7fe commit d9668ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ module Gist
176176
url = write(files, private_gist)
177177
browse(url) if browse_enabled
178178
copy(url) if copy
179-
puts url
179+
$stdout.tty? ? puts(url) : print(url)
180180
rescue => e
181181
warn e
182182
puts opts

0 commit comments

Comments
 (0)