spaceship 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 404634d202a34615660b5239a2fc6b9edb449197
4
- data.tar.gz: 0d6101044d0e1b639234ee2611b979a4f5ccc204
3
+ metadata.gz: f6a3c818e30dc1104176737eb6b122347a533a4d
4
+ data.tar.gz: 0cdad36a2f668ea79dff96eb82c40d9a2a8e31f8
5
5
  SHA512:
6
- metadata.gz: 066a803865cc2b93315969b270837c7c3204880e8a8cee1b5a27d60d29c0dfbef5c81544f27b348e1fffbc848e52a26899f35fc3977d05f323911753c7984d61
7
- data.tar.gz: 3b3b7cf7ab39726200c01fb5d866c15bac3c81e359a335c797bd6f51ad72112ba5307b34dfc21621f77b901bb76b2ecbc26b83030f9a66b48b222a49a21ee1b6
6
+ metadata.gz: bc714965c65ca0e17be95cd9a9825cedef4c3708100b05862db1ff60be617426efdc0d4e9943566c90c5a6913ccc5e8ed692105463eb0df814f646418f4f9b3c
7
+ data.tar.gz: 7c30613baa1293ccba3a33e744c952e2e05b24eb05d3cb42ab8937cd68a006e5711e7b3e9c7e61b4677809cd1467f8f140a6f47ca9186214ae64f8f31641b156
@@ -35,13 +35,27 @@ module Spaceship
35
35
  teams = client.teams
36
36
 
37
37
  raise "Your account is in no teams" if teams.count == 0
38
+
39
+ user_team = (ENV['FASTLANE_TEAM_ID'] || '').strip
40
+ if user_team
41
+ # User provided a value, let's see if it's valid
42
+ puts "Looking for team with ID '#{user_team}'"
43
+ teams.each_with_index do |team, i|
44
+ return user_team if (team['teamId'].strip == user_team)
45
+ end
46
+ puts "Couldn't find team with ID '#{user_team}'"
47
+ end
48
+
49
+
38
50
  return teams[0]['teamId'] if teams.count == 1 # user is just in one team
39
51
 
52
+
53
+ # User Selection
40
54
  loop do
41
55
  # Multiple teams, user has to select
42
- puts "Multiple teams found, please enter the number of the team you want to use: ".yellow
56
+ puts "Multiple teams found, please enter the number of the team you want to use: "
43
57
  teams.each_with_index do |team, i|
44
- puts "#{i + 1}) #{team['teamId']} #{team['name']} (#{team['type']})".green
58
+ puts "#{i + 1}) #{team['teamId']} #{team['name']} (#{team['type']})"
45
59
  end
46
60
 
47
61
  selected = $stdin.gets.strip.to_i - 1
@@ -1,3 +1,3 @@
1
1
  module Spaceship
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spaceship
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Natchev
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-26 00:00:00.000000000 Z
12
+ date: 2015-05-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: credentials_manager