travis_reprise 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/travis_reprise +4 -2
- data/travis_reprise.gemspec +1 -1
- metadata +1 -1
data/bin/travis_reprise
CHANGED
@@ -15,8 +15,9 @@ unless user && repo && branch
|
|
15
15
|
exit 1
|
16
16
|
end
|
17
17
|
|
18
|
+
cfg_file = File.read(File.expand_path('~/.travis-reprise.json'))
|
18
19
|
begin
|
19
|
-
config = JSON.parse(
|
20
|
+
config = JSON.parse(cfg_file)
|
20
21
|
rescue Errno::ENOENT
|
21
22
|
$stdout.sync = true
|
22
23
|
print "Github Username: "
|
@@ -30,9 +31,10 @@ rescue Errno::ENOENT
|
|
30
31
|
json = `curl -u '#{u}:#{p}' -d '{"scopes":["repo"],"note":"Travis Reprise"}' https://api.github.com/authorizations 2>/dev/null`
|
31
32
|
data = JSON.parse(json)
|
32
33
|
if data['token']
|
33
|
-
File.open(
|
34
|
+
File.open(cfg_file, 'w') do |f|
|
34
35
|
f << json
|
35
36
|
end
|
37
|
+
`chmod 600 #{cfg_file}`
|
36
38
|
else
|
37
39
|
puts "#{data['message']}: try again"
|
38
40
|
end
|
data/travis_reprise.gemspec
CHANGED