Skip to content

Commit 09813a3

Browse files
author
esteban zapata
committed
gist: Validate auth token existence before any action.
1 parent 4fce19e commit 09813a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bin/gist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ Usage: #{executable_name} [-o|-c|-e] [-p] [-s] [-R] [-d DESC] [-a] [-u URL]
148148
end.parse!
149149

150150
begin
151+
if Gist.auth_token.nil?
152+
puts 'Please log in with `gist --login`. ' \
153+
'(Github now requires credentials to gist https://bit.ly/2GBBxKw)'
154+
exit(1)
155+
end
156+
151157
options[:output] = if options[:embed] && options[:shorten]
152158
raise Gist::Error, "--embed does not make sense with --shorten"
153159
elsif options[:embed]

0 commit comments

Comments
 (0)