File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
ZipBuilder/Sources/ZipBuilder Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -169,17 +169,19 @@ struct LaunchArgs {
169
169
defaults. register ( defaults: [ Key . buildDependencies. rawValue: true ] )
170
170
171
171
// Get the project repo directory, and fail if it doesn't exist and we're building Firebase.
172
- let repoPath = defaults. string ( forKey: Key . repoDir. rawValue)
173
- if defaults. string ( forKey: Key . zipPods. rawValue) != nil {
172
+ if let repoPath = defaults. string ( forKey: Key . repoDir. rawValue) {
173
+ repoDir = URL ( fileURLWithPath: repoPath)
174
+ } else if defaults. string ( forKey: Key . zipPods. rawValue) != nil {
174
175
LaunchArgs . exitWithUsageAndLog ( " Missing required key: ` \( Key . repoDir) ` for the folder " +
175
176
" containing the repository from which we're building the zip. " )
177
+ } else {
178
+ repoDir = nil
176
179
}
177
- repoDir = repoPath != nil ? URL ( fileURLWithPath: repoPath!) : nil
178
180
179
181
// Get the project template directory, and fail if it doesn't exist.
180
182
var templatePath = defaults. string ( forKey: Key . templateDir. rawValue)
181
- if templatePath == nil , repoPath != nil {
182
- templatePath = repoPath! + " /ZipBuilder/Template "
183
+ if templatePath == nil , let repoDir = repoDir {
184
+ templatePath = repoDir . path + " /ZipBuilder/Template "
183
185
} else {
184
186
LaunchArgs . exitWithUsageAndLog ( " Missing required key: ` \( Key . templateDir) ` for the folder " +
185
187
" containing all required files to build frameworks. " )
Original file line number Diff line number Diff line change @@ -162,11 +162,9 @@ struct ZipBuilder {
162
162
/// - Returns: Information related to the built artifacts.
163
163
/// - Throws: One of many errors that could have happened during the build phase.
164
164
func buildAndAssembleFirebaseRelease( inProjectDir projectDir: URL ) throws -> ReleaseArtifacts {
165
- var podsToInstall : [ CocoaPodUtils . VersionedPod ] = [ ]
166
165
let manifest = FirebaseManifest . shared
167
- for pod in ( manifest. pods. filter { $0. zip } ) {
168
- podsToInstall. append ( CocoaPodUtils . VersionedPod ( name: pod. name,
169
- version: manifest. versionString ( pod) ) )
166
+ var podsToInstall = manifest. pods. filter { $0. zip } . map {
167
+ CocoaPodUtils . VersionedPod ( name: $0. name, version: manifest. versionString ( $0) )
170
168
}
171
169
guard !podsToInstall. isEmpty else {
172
170
fatalError ( " Failed to find versions for Firebase release " )
You can’t perform that action at this time.
0 commit comments