unlimit 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f0d63bfe3f58eedb80bb39ac06f2c20e9ff22d268b356068f50a1b2017a8c524
4
- data.tar.gz: 3aff281c9e65c190bcd5b56d923234d7fa0262cac85ca545398f0d34d630e061
3
+ metadata.gz: 64910bcea88748af831ed1b221261baddfba9a2c221e59a2db147cf221328495
4
+ data.tar.gz: 22e80f08ff8d80ae3b88a1b2ab57ec07c84605c483a86822fce296247da63406
5
5
  SHA512:
6
- metadata.gz: 661a2ea9e6dcd0f0e58979b22a26176eb805d3470838dbff4cf510dc523d4364583e79ffdb350b4a93327dfdc6bd77a07742a304072d20dff835e275f27f6f87
7
- data.tar.gz: 940d896d9bc981730d3b12c8dcb1815ecacf66218a05689a19c0cf87f19d8fc8decd725b2b51964c3fa194abfae7d929973d6f06f26463acd14a7ffe5068cf90
6
+ metadata.gz: c36b20fa8716eabc1106726862e8c37db39fd027d0d2091c6e7ae5ffae07182a5f4ed97e37b56cac9eb64a775a7c24c9d46d46761700179820a8b3ee109fbc6d
7
+ data.tar.gz: 860f86c273318e15a92ff0ad7ba8174a7ffa217b0851f210cc9dcbc082047034cc6867e80ed7b6202065c34689b93c0e1a223f8e0ca4ba3f59ff7e3e72ea8d7a
@@ -1,5 +1,18 @@
1
1
  # Change Log
2
2
 
3
+ ## [0.0.7](https://github.com/biocross/unlimit/releases/tag/0.0.7)
4
+ Released on 2019-08-26.
5
+
6
+ #### Fixed
7
+ - Fixed issues when running Unlimit without bundler
8
+ - Fixed issues when detecting personal teams without email addresses
9
+
10
+ ## 0.0.6
11
+ Released on 2019-08-26.
12
+
13
+ #### Fixed
14
+ - Fixes a crash when running Unlimit without bundler.
15
+
3
16
  ## [0.0.5](https://github.com/biocross/unlimit/releases/tag/0.0.5)
4
17
  Released on 2019-08-25.
5
18
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- unlimit (0.0.6)
4
+ unlimit (0.0.7)
5
5
  configure_extensions
6
6
  fastlane (>= 2.116.0)
7
7
  highline
@@ -12,7 +12,7 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- CFPropertyList (3.0.0)
15
+ CFPropertyList (3.0.1)
16
16
  activesupport (4.2.11.1)
17
17
  i18n (~> 0.7)
18
18
  minitest (~> 5.1)
@@ -93,9 +93,9 @@ GEM
93
93
  representable (~> 3.0)
94
94
  retriable (>= 2.0, < 4.0)
95
95
  signet (~> 0.9)
96
- google-cloud-core (1.3.0)
96
+ google-cloud-core (1.3.1)
97
97
  google-cloud-env (~> 1.0)
98
- google-cloud-env (1.2.0)
98
+ google-cloud-env (1.2.1)
99
99
  faraday (~> 0.11)
100
100
  google-cloud-storage (1.16.0)
101
101
  digest-crc (~> 0.4)
@@ -3,10 +3,29 @@
3
3
 
4
4
  require 'unlimit'
5
5
  require 'optparse'
6
+ require 'sentry-raven'
7
+
8
+ def using_bundler
9
+ %w[BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |current|
10
+ return true if ENV.key?(current)
11
+ end
12
+ false
13
+ end
6
14
 
7
15
  unlimiter = Unlimit::CLI.new
8
16
  options = {}
9
17
 
18
+ Raven.configure do |config|
19
+ config.silence_ready = true
20
+ config.logger = Raven::Logger.new(nil)
21
+ config.dsn = 'https://bcd26f187d56482ca4fd1b6732103e87:7f5c3421630b4f50804525bfdfa25d6d@sentry.io/1541037'
22
+ end
23
+
24
+ Raven.tags_context(
25
+ bundler: using_bundler,
26
+ unlimit_version: Unlimit::VERSION
27
+ )
28
+
10
29
  OptionParser.new do |opt|
11
30
  opt.on('--project XCODEPROJ') { |o| options['project_path'] = o }
12
31
  opt.on('--plist INFO_PLIST') { |o| options['plist_path'] = o }
@@ -17,4 +36,6 @@ OptionParser.new do |opt|
17
36
  opt.on('--version') { unlimiter.showVersion }
18
37
  end.parse!
19
38
 
20
- unlimiter.start(options)
39
+ Raven.capture do
40
+ unlimiter.start(options, using_bundler, Raven)
41
+ end
@@ -3,10 +3,29 @@
3
3
 
4
4
  require 'unlimit'
5
5
  require 'optparse'
6
+ require 'sentry-raven'
7
+
8
+ def using_bundler
9
+ %w[BUNDLE_BIN_PATH BUNDLE_GEMFILE].each do |current|
10
+ return true if ENV.key?(current)
11
+ end
12
+ false
13
+ end
6
14
 
7
15
  unlimiter = Unlimit::CLI.new
8
16
  options = {}
9
17
 
18
+ Raven.configure do |config|
19
+ config.silence_ready = true
20
+ config.logger = Raven::Logger.new(nil)
21
+ config.dsn = 'https://bcd26f187d56482ca4fd1b6732103e87:7f5c3421630b4f50804525bfdfa25d6d@sentry.io/1541037'
22
+ end
23
+
24
+ Raven.tags_context(
25
+ bundler: using_bundler,
26
+ unlimit_version: Unlimit::VERSION
27
+ )
28
+
10
29
  OptionParser.new do |opt|
11
30
  opt.on('--project XCODEPROJ') { |o| options['project_path'] = o }
12
31
  opt.on('--plist INFO_PLIST') { |o| options['plist_path'] = o }
@@ -17,4 +36,6 @@ OptionParser.new do |opt|
17
36
  opt.on('--version') { unlimiter.showVersion }
18
37
  end.parse!
19
38
 
20
- unlimiter.start(options)
39
+ Raven.capture do
40
+ unlimiter.start(options, using_bundler, Raven)
41
+ end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'unlimit/version'
4
- require 'sentry-raven'
5
4
  require 'xcodeproj'
6
5
  require 'securerandom'
7
6
  require 'json'
@@ -38,256 +37,245 @@ module Unlimit
38
37
  abort
39
38
  end
40
39
 
41
- def start(options)
42
- Raven.configure do |config|
43
- config.silence_ready = true
44
- config.logger = Raven::Logger.new(nil)
45
- config.dsn = 'https://bcd26f187d56482ca4fd1b6732103e87:7f5c3421630b4f50804525bfdfa25d6d@sentry.io/1541037'
46
- end
40
+ def start(options, using_bundler, raven)
41
+ puts Divider
42
+ puts " unlimit 🚀📲 (#{Unlimit::VERSION}) "
43
+ puts ' Switching your project to Personal Team! '.yellow
44
+ puts Divider
47
45
 
48
- Raven.tags_context(
49
- unlimit_version: Unlimit::VERSION
50
- )
51
-
52
- Raven.capture do
53
- puts Divider
54
- puts " unlimit 🚀📲 (#{Unlimit::VERSION}) "
55
- puts ' Switching your project to Personal Team! '.yellow
56
- puts Divider
57
-
58
- xcode_project_files = Dir.glob('*.xcodeproj')
59
- project_path = ''
60
- plist_path = ''
61
- target_name = ''
62
- personal_team_id = ''
63
- uses_app_groups = false
64
- app_group_name = ''
65
- entitlements_file = ''
66
- project_configuration_file = ''
67
- extensions = []
68
- target = nil
69
- session_uuid = SecureRandom.uuid
70
-
71
- cli = HighLine.new
72
- Raven.capture_message('Begin', :level => 'info')
73
-
74
- # Check for a valid xcode_project
75
- if xcode_project_files.count == 1 || options.key?(ProjectPathKey)
76
- project_path = if options.key?(ProjectPathKey)
77
- options[ProjectPathKey]
78
- else
79
- xcode_project_files.first
80
- end
81
-
82
- unless File.directory?(project_path)
83
- abort("Project not found at #{project_path}".red)
84
- end
85
- putsWithOverrides('project', project_path, ProjectPathKey)
86
- else
87
- abort('Please specify the .xcodeproj project file to use with the --project option like --project MyProject.xcodeproj'.red)
46
+ xcode_project_files = Dir.glob('*.xcodeproj')
47
+ project_path = ''
48
+ plist_path = ''
49
+ target_name = ''
50
+ personal_team_id = ''
51
+ uses_app_groups = false
52
+ app_group_name = ''
53
+ entitlements_file = ''
54
+ project_configuration_file = ''
55
+ extensions = []
56
+ target = nil
57
+ session_uuid = SecureRandom.uuid
58
+ fastlane_command = using_bundler ? 'bundle exec fastlane' : 'fastlane'
59
+
60
+ cli = HighLine.new
61
+ raven.capture_message('Begin', level: 'info')
62
+
63
+ # Check for a valid xcode_project
64
+ if xcode_project_files.count == 1 || options.key?(ProjectPathKey)
65
+ project_path = if options.key?(ProjectPathKey)
66
+ options[ProjectPathKey]
67
+ else
68
+ xcode_project_files.first
69
+ end
70
+
71
+ unless File.directory?(project_path)
72
+ abort("Project not found at #{project_path}".red)
88
73
  end
74
+ putsWithOverrides('project', project_path, ProjectPathKey)
75
+ else
76
+ abort('Please specify the .xcodeproj project file to use with the --project option like --project MyProject.xcodeproj'.red)
77
+ end
89
78
 
90
- project = Xcodeproj::Project.open(project_path)
79
+ project = Xcodeproj::Project.open(project_path)
91
80
 
92
- if options.key?(TargetNameKey)
93
- target_name = options[TargetNameKey]
94
- target = project.targets.find { |t| t.name == target_name }
95
- abort "Couldn't find the target '#{target_name}' in '#{project_path}'" if target.nil?
96
- puts "Using target #{target_name}"
97
- else
98
- project.targets.each do |current_target|
99
- next unless current_target.product_type == ProductTypeApplicationTarget
81
+ if options.key?(TargetNameKey)
82
+ target_name = options[TargetNameKey]
83
+ target = project.targets.find { |t| t.name == target_name }
84
+ abort "Couldn't find the target '#{target_name}' in '#{project_path}'" if target.nil?
85
+ puts "Using target #{target_name}"
86
+ else
87
+ project.targets.each do |current_target|
88
+ next unless current_target.product_type == ProductTypeApplicationTarget
100
89
 
101
- target = current_target
102
- target_name = current_target.name
103
- putsWithOverrides('target', target_name, TargetNameKey)
90
+ target = current_target
91
+ target_name = current_target.name
92
+ putsWithOverrides('target', target_name, TargetNameKey)
104
93
 
105
- # Remove Fabric Script build phase to stop the annoying "new app" email
106
- unless options.key?(KeepFabricKey)
107
- current_target.build_phases.each do |build_phase|
108
- next unless build_phase.is_a?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) && build_phase.shell_script.include?('/Fabric/run')
94
+ # Remove Fabric Script build phase to stop the annoying "new app" email
95
+ unless options.key?(KeepFabricKey)
96
+ current_target.build_phases.each do |build_phase|
97
+ next unless build_phase.is_a?(Xcodeproj::Project::Object::PBXShellScriptBuildPhase) && build_phase.shell_script.include?('/Fabric/run')
109
98
 
110
- build_phase.shell_script = '#' + build_phase.shell_script
111
- end
99
+ build_phase.shell_script = '#' + build_phase.shell_script
112
100
  end
113
- break
114
101
  end
102
+ break
115
103
  end
104
+ end
116
105
 
117
- if options.key?(PlistPathKey)
118
- plist_path = options[PlistPathKey]
106
+ if options.key?(PlistPathKey)
107
+ plist_path = options[PlistPathKey]
119
108
 
120
- unless File.file?(plist_path)
121
- abort("Info.plist file not found at path: #{plist_path}".red)
122
- end
123
- puts "Using Info.plist at path #{plist_path}.".green
124
- else
125
- if target.build_configurations.count > 0
126
- build_settings = target.build_configurations.first.build_settings
127
- plist_path = build_settings[InfoPlistBuildSettingKey]
128
- putsWithOverrides('Info.plist', plist_path, PlistPathKey)
129
- end
109
+ unless File.file?(plist_path)
110
+ abort("Info.plist file not found at path: #{plist_path}".red)
111
+ end
112
+ puts "Using Info.plist at path #{plist_path}.".green
113
+ else
114
+ if target.build_configurations.count.positive?
115
+ build_settings = target.build_configurations.first.build_settings
116
+ plist_path = build_settings[InfoPlistBuildSettingKey]
117
+ putsWithOverrides('Info.plist', plist_path, PlistPathKey)
118
+ end
130
119
 
131
- if plist_path.nil? || plist_path.empty?
132
- abort('Please specify the path to your main target\'s Info.plist file with the --plist option like --plist MyProject-Info.plist'.red)
133
- end
120
+ if plist_path.nil? || plist_path.empty?
121
+ abort('Please specify the path to your main target\'s Info.plist file with the --plist option like --plist MyProject-Info.plist'.red)
134
122
  end
123
+ end
135
124
 
136
- if options.key?(ProjectConfigurationFileKey)
137
- project_configuration_file = options[ProjectConfigurationFileKey]
125
+ if options.key?(ProjectConfigurationFileKey)
126
+ project_configuration_file = options[ProjectConfigurationFileKey]
138
127
 
139
- unless File.file?(project_configuration_file)
140
- abort("YAML Configuration file not found at path: #{project_configuration_file}".red)
141
- end
142
- puts "Using YAML Configuration at path #{project_configuration_file}.".green
143
- else
144
- project_configuration_file = DefaultProjectConfigurationFilePath
145
- putsWithOverrides('YAML Configuration', project_configuration_file, ProjectConfigurationFileKey)
128
+ unless File.file?(project_configuration_file)
129
+ abort("YAML Configuration file not found at path: #{project_configuration_file}".red)
146
130
  end
131
+ puts "Using YAML Configuration at path #{project_configuration_file}.".green
132
+ else
133
+ project_configuration_file = DefaultProjectConfigurationFilePath
134
+ putsWithOverrides('YAML Configuration', project_configuration_file, ProjectConfigurationFileKey) if File.file?(project_configuration_file)
135
+ end
147
136
 
148
- project.targets.each do |target|
149
- if target.product_type.include? 'app-extension'
150
- extensions.push(target.name)
151
- end
137
+ project.targets.each do |target|
138
+ if target.product_type.include? 'app-extension'
139
+ extensions.push(target.name)
152
140
  end
141
+ end
153
142
 
154
- if options.key?(TeamIDKey)
155
- personal_team_id = options[TeamIDKey]
156
- putsWithOverrides('Team ID', personal_team_id, TeamIDKey)
143
+ if options.key?(TeamIDKey)
144
+ personal_team_id = options[TeamIDKey]
145
+ putsWithOverrides('Team ID', personal_team_id, TeamIDKey)
146
+ else
147
+ valid_codesigning_identities, stderr, status = Open3.capture3('security find-identity -p codesigning -v')
148
+ personal_teams = valid_codesigning_identities.scan(/\"(.+Developer.+)\"/i)
149
+ if personal_teams.size == 1
150
+ personal_team_name = personal_teams.first.strip
151
+ personal_team_id, stderr, status = Open3.capture3("security find-certificate -c #{personal_team_name} -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
152
+ personal_team_id = personal_team_id.strip
157
153
  else
158
- valid_codesigning_identities, stderr, status = Open3.capture3('security find-identity -p codesigning -v')
159
- personal_teams = valid_codesigning_identities.scan(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i)
160
- if personal_teams.size == 1
161
- personal_team_name = personal_teams.first.strip
162
- personal_team_id, stderr, status = Open3.capture3("security find-certificate -c #{personal_team_name} -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
163
- personal_team_id = personal_team_id.strip
164
- putsWithOverrides("Team ID (from: #{personal_team_name})", personal_team_id, TeamIDKey)
165
- else
166
- puts "\nYou have quite a few developer identities on your machine. unlimit is unable to decide which one to use 😅".yellow
167
- puts 'If you know the Team ID to use, pass it with the --teamid flag like --teamid 6A2T6455Y3'.yellow
168
- puts "\nFor now, choose one from the list below: (The one most likely to work will have your email)".yellow
169
- puts 'Which codesigning identity should unlimit use?'.green
170
- selected_team = ''
171
- codesigning_options = valid_codesigning_identities.split("\n")
172
- codesigning_options = codesigning_options.select { |line| line.include?(')') }
173
- codesigning_options = codesigning_options.map { |identity| identity.scan(/\d+\) (.+)/).first.first }
174
- cli.choose do |menu|
175
- menu.prompt = 'Select one by entering the number: '
176
- codesigning_options.each do |identity|
177
- menu.choice(identity) { cli.say(identity); selected_team = identity }
178
- end
154
+ puts "\nYou have quite a few developer identities on your machine. unlimit is unable to decide which one to use 😅".yellow
155
+ puts 'If you know the Team ID to use, pass it with the --teamid flag like --teamid 6A2T6455Y3'.yellow
156
+ puts "\nFor now, choose one from the list below: (Your personal team most likely contains your email or full name)".yellow
157
+ puts 'Which codesigning identity should unlimit use?'.green
158
+ selected_team = ''
159
+ codesigning_options = valid_codesigning_identities.split("\n")
160
+ codesigning_options = codesigning_options.select { |line| line.include?(')') }
161
+ codesigning_options = codesigning_options.map { |identity| identity.scan(/\d+\) (.+)/).first.first }
162
+ cli.choose do |menu|
163
+ menu.prompt = 'Select one by entering the number: '
164
+ codesigning_options.each do |identity|
165
+ menu.choice(identity) { selected_team = identity }
179
166
  end
180
-
181
- personal_team = selected_team.scan(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i)
182
- personal_team_name = personal_team.first.strip
183
- personal_team_id, stderr, status = Open3.capture3("security find-certificate -c #{personal_team_name} -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
184
- personal_team_id = personal_team_id.strip
185
- putsWithOverrides("Team ID (from: #{personal_team_name})", personal_team_id, TeamIDKey)
186
167
  end
168
+
169
+ personal_team = selected_team.scan(/:(.+)\(.+\)\"/i)
170
+ personal_team_name = personal_team.first.first.strip
171
+ personal_team_id, stderr, status = Open3.capture3("security find-certificate -c \"#{personal_team_name}\" -p | openssl x509 -text | grep -o OU=[^,]* | grep -v Apple | sed s/OU=//g")
172
+ personal_team_id = personal_team_id.strip
187
173
  end
174
+ putsWithOverrides("Team ID (from: #{personal_team_name})", personal_team_id, TeamIDKey)
175
+ end
188
176
 
189
- puts "#{Divider}\n"
177
+ puts "#{Divider}\n"
190
178
 
191
- # Turn off capabilities that require entitlements
192
- puts 'Turning OFF all Capabilities'.red
193
- project.root_object.attributes.each do |value|
194
- next unless value[0] == 'TargetAttributes'
179
+ # Turn off capabilities that require entitlements
180
+ puts 'Turning OFF all Capabilities'.red
181
+ project.root_object.attributes.each do |value|
182
+ next unless value[0] == 'TargetAttributes'
195
183
 
196
- hash = value[1]
197
- hash.each do |_key, val|
198
- next unless val.key?('SystemCapabilities')
184
+ hash = value[1]
185
+ hash.each do |_key, val|
186
+ next unless val.key?('SystemCapabilities')
199
187
 
200
- capabilities = val['SystemCapabilities']
201
- capabilities.each do |key, val|
202
- next unless val.key?('enabled')
188
+ capabilities = val['SystemCapabilities']
189
+ capabilities.each do |key, val|
190
+ next unless val.key?('enabled')
203
191
 
204
- if key.include?('com.apple.ApplicationGroups.iOS')
205
- uses_app_groups = true
206
- end
192
+ if key.include?('com.apple.ApplicationGroups.iOS')
193
+ uses_app_groups = true
194
+ end
207
195
 
208
- unless CapabilitiesWhitelist.include?(key)
209
- puts ' Turning OFF ' + key
210
- capabilities[key]['enabled'] = '0'
211
- end
196
+ unless CapabilitiesWhitelist.include?(key)
197
+ puts ' Turning OFF ' + key
198
+ capabilities[key]['enabled'] = '0'
212
199
  end
213
200
  end
214
201
  end
215
- project.save
216
-
217
- # Remove Entitlements
218
- puts 'Clearing entitlements...'.red
219
- Dir.glob('**/*.entitlements').each do |source_file|
220
- entitlements_plist = uses_app_groups ? { "com.apple.security.application-groups": '' }.to_plist : {}.to_plist
221
- entitlements_file = source_file if uses_app_groups
222
- File.open(source_file, 'w') { |file| file.puts entitlements_plist }
223
- end
202
+ end
203
+ project.save
204
+
205
+ # Remove Entitlements
206
+ puts 'Clearing entitlements...'.red
207
+ Dir.glob('**/*.entitlements').each do |source_file|
208
+ entitlements_plist = uses_app_groups ? { "com.apple.security.application-groups": '' }.to_plist : {}.to_plist
209
+ entitlements_file = source_file if uses_app_groups
210
+ File.open(source_file, 'w') { |file| file.puts entitlements_plist }
211
+ end
224
212
 
225
- # Remove Capability Keys from Plist
226
- puts 'Removing capabilities from Info.plist...'.red
227
- info_plist = Plist.parse_xml(plist_path)
228
- info_plist.delete('UIBackgroundModes')
229
- File.open(plist_path, 'w') { |file| file.puts info_plist.to_plist }
230
-
231
- # Change Bundle Identifier
232
- puts 'Changing bundle identifier...'.red
233
- bundle_identifier = "com.unlimit.#{session_uuid}"
234
- system("#{FastlaneEnvironmentVariables} bundle exec fastlane run update_app_identifier plist_path:#{plist_path} app_identifier:#{bundle_identifier}")
235
-
236
- if uses_app_groups # Create a temporary fastfile, and set the app group identifiers
237
- app_group_name = "group.#{bundle_identifier}"
238
- fastfile = "lane :set_app_group do
239
- update_app_group_identifiers(entitlements_file: \"#{entitlements_file}\", app_group_identifiers: ['#{app_group_name}'])
240
- end"
241
-
242
- existingFastfile = ''
243
- if File.file?(FastFilePath)
244
- File.open('./fastlane/Fastfile', 'r') do |file|
245
- existingFastfile = file.read
246
- end
213
+ # Remove Capability Keys from Plist
214
+ puts 'Removing capabilities from Info.plist...'.red
215
+ info_plist = Plist.parse_xml(plist_path)
216
+ info_plist.delete('UIBackgroundModes')
217
+ File.open(plist_path, 'w') { |file| file.puts info_plist.to_plist }
218
+
219
+ # Change Bundle Identifier
220
+ puts 'Changing bundle identifier...'.red
221
+ bundle_identifier = "com.unlimit.#{session_uuid}"
222
+ system("#{FastlaneEnvironmentVariables} #{fastlane_command} run update_app_identifier plist_path:#{plist_path} app_identifier:#{bundle_identifier}")
223
+
224
+ if uses_app_groups # Create a temporary fastfile, and set the app group identifiers
225
+ app_group_name = "group.#{bundle_identifier}"
226
+ fastfile = "lane :set_app_group do
227
+ update_app_group_identifiers(entitlements_file: \"#{entitlements_file}\", app_group_identifiers: ['#{app_group_name}'])
228
+ end"
229
+
230
+ existing_fastfile = ''
231
+ if File.file?(FastFilePath)
232
+ File.open('./fastlane/Fastfile', 'r') do |file|
233
+ existing_fastfile = file.read
247
234
  end
248
- File.open(FastFilePath, 'w') do |file|
249
- file.write(fastfile)
250
- end
251
- system("#{FastlaneEnvironmentVariables} bundle exec fastlane set_app_group")
252
- existingFastfile.empty? ? File.delete(FastFilePath) : File.open('./fastlane/Fastfile', 'w') { |file| file.write(existingFastfile) }
253
235
  end
236
+ File.open(FastFilePath, 'w') do |file|
237
+ file.write(fastfile)
238
+ end
239
+ system("#{FastlaneEnvironmentVariables} #{fastlane_command} fastlane set_app_group")
240
+ existing_fastfile.empty? ? File.delete(FastFilePath) : File.open('./fastlane/Fastfile', 'w') { |file| file.write(existing_fastfile) }
241
+ end
254
242
 
255
- puts 'Enabling Automatic Code Signing...'.red
256
- system("#{FastlaneEnvironmentVariables} bundle exec fastlane run automatic_code_signing use_automatic_signing:true targets:#{target_name}")
243
+ puts 'Enabling Automatic Code Signing...'.red
244
+ system("#{FastlaneEnvironmentVariables} #{fastlane_command} fastlane run automatic_code_signing use_automatic_signing:true targets:#{target_name}")
257
245
 
258
- puts 'Switching to Personal Team...'.red
259
- system("#{FastlaneEnvironmentVariables} bundle exec fastlane run update_project_team teamid:\"#{personal_team_id}\" targets:#{target_name}")
246
+ puts 'Switching to Personal Team...'.red
247
+ system("#{FastlaneEnvironmentVariables} #{fastlane_command} fastlane run update_project_team teamid:\"#{personal_team_id}\" targets:#{target_name}")
260
248
 
261
- # Remove App Extensions
262
- unless extensions.empty?
263
- app_extensions = extensions.join(', ')
264
- puts "Removing App Extensions: #{app_extensions}".red
265
- system("bundle exec configure_extensions remove #{project_path} #{target_name} #{app_extensions}")
266
- end
249
+ # Remove App Extensions
250
+ unless extensions.empty?
251
+ app_extensions = extensions.join(', ')
252
+ puts "Removing App Extensions: #{app_extensions}".red
253
+ system("#{'bundle exec' if using_bundler} configure_extensions remove #{project_path} #{target_name} #{app_extensions}")
254
+ end
267
255
 
268
- if File.file?(project_configuration_file)
269
- puts "Running Custom Scripts from #{project_configuration_file}".red
270
- local_configuration = YAML.load_file(project_configuration_file)
271
- unless local_configuration['custom_scripts'].empty?
272
- environment_variables = { 'UNLIMIT_PROJECT_PATH' => project_path, 'UNLIMIT_TARGET_NAME' => target_name, 'UNLIMIT_PLIST_PATH' => plist_path, 'UNLIMIT_TEAM_ID' => personal_team_id, 'UNLIMIT_APP_BUNDLE_ID' => bundle_identifier, 'UNLIMIT_APP_GROUP_NAME' => app_group_name }
273
- local_configuration['custom_scripts'].each do |script|
274
- script = script.to_s
275
- environment_variables.each do |key, variable|
276
- script.gsub!(key.to_s, variable.to_s)
277
- end
278
- puts "Running: #{script}".green
279
- output, stderr, status = Open3.capture3(script)
280
- puts output unless output.empty?
281
- puts stderr unless stderr.empty?
282
- puts "Done with Status: #{status}"
256
+ if File.file?(project_configuration_file)
257
+ puts "Running Custom Scripts from #{project_configuration_file}".red
258
+ local_configuration = YAML.load_file(project_configuration_file)
259
+ unless local_configuration['custom_scripts'].empty?
260
+ environment_variables = { 'UNLIMIT_PROJECT_PATH' => project_path, 'UNLIMIT_TARGET_NAME' => target_name, 'UNLIMIT_PLIST_PATH' => plist_path, 'UNLIMIT_TEAM_ID' => personal_team_id, 'UNLIMIT_APP_BUNDLE_ID' => bundle_identifier, 'UNLIMIT_APP_GROUP_NAME' => app_group_name }
261
+ local_configuration['custom_scripts'].each do |script|
262
+ script = script.to_s
263
+ environment_variables.each do |key, variable|
264
+ script.gsub!(key.to_s, variable.to_s)
283
265
  end
284
- end
285
- end
286
- Raven.capture_message('Finished', :level => 'info')
287
- puts "\n#{Divider}"
288
- puts 'You\'re good to go! Just connect your device and hit run!'.green
289
- puts Divider
266
+ puts "Running: #{script}".green
267
+ output, stderr, status = Open3.capture3(script)
268
+ puts output unless output.empty?
269
+ puts stderr unless stderr.empty?
270
+ puts "Done with Status: #{status}"
271
+ end
272
+ end
290
273
  end
291
- end
274
+
275
+ raven.capture_message('Finished', level: 'info')
276
+ puts "\n#{Divider}"
277
+ puts 'You\'re good to go! Just connect your device and hit run!'.green
278
+ puts Divider
279
+ end
292
280
  end
293
281
  end
@@ -1,3 +1,3 @@
1
1
  module Unlimit
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unlimit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siddharth Gupta