github_issues_cli 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/github_issues_cli/command.rb +7 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b359a6a8734c1077f8eb2f7498168cbd05a359
|
4
|
+
data.tar.gz: 8cffb718a8d83ab8529d193ce4fb0f79464958d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d02956d6cda51bc256530265e59413900010916ffab102108657d7532cdf6d0cc55c4fba1ae414c818a2ea125a626776ff06ab7b9eca023a3814aa5c6107dd23
|
7
|
+
data.tar.gz: 88edc6bebb99ff48123bb1949036fe3b82366a58ca048aff65f2fadcfb36cc49bf2ed677878a5c3fceeb41fddb9608215bff566c6c77c0f4b6cefb82ac7ba0c2
|
@@ -14,16 +14,20 @@ module GithubIssuesCli
|
|
14
14
|
config_dirname = ENV['HOME'] + '/.github-issues/'
|
15
15
|
Dir.mkdir config_dirname unless Dir.exists? config_dirname
|
16
16
|
|
17
|
-
config_path = config_dirname + '
|
17
|
+
config_path = config_dirname + 'config'
|
18
18
|
if File.exists? config_path
|
19
|
-
|
19
|
+
file = File.new(config_path, 'r')
|
20
|
+
config = JSON.parse file.gets
|
21
|
+
file.close
|
20
22
|
@username, token = config.values_at 'username', 'token'
|
21
23
|
else
|
22
24
|
print 'Please provide GitHub token: '
|
23
25
|
token = $stdin.gets.chomp
|
24
26
|
@username = Github::Users.new.get(:oauth_token => token).login
|
25
27
|
config = {:username => @username, :token => token}
|
26
|
-
File.new(config_path, 'w')
|
28
|
+
file = File.new(config_path, 'w')
|
29
|
+
file.puts config.to_json
|
30
|
+
file.close
|
27
31
|
end
|
28
32
|
|
29
33
|
Github.configure do |c|
|