lib/furik/configurable.rb in furik-0.1.0 vs lib/furik/configurable.rb in furik-0.1.1
- old
+ new
@@ -11,9 +11,11 @@
def token_generate_path
'/settings/tokens/new'
end
def token_by_hub(host = 'github.com')
+ return unless File.exist?(hub_config_path)
+
hub_config = YAML.load_file hub_config_path
if !hub_config[host].nil? && !hub_config[host].empty?
hub_config[host].last['oauth_token']
end
end