Skip to content

Commit

Permalink
fix(core, ios): ensure iOS SDK can be found from Package.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Nov 7, 2024
1 parent 17dfff1 commit 1c1b0ef
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ enum ConfigurationError: Error {
case invalidFormat(String)
}

let iosRootDirectory = String(URL(string: #file)!.deletingLastPathComponent().absoluteString
let firebaseCoreDirectory = String(URL(string: #file)!.deletingLastPathComponent().absoluteString
.dropLast())

func loadPubspecVersion() throws -> String {
let pubspecPath = NSString.path(withComponents: [iosRootDirectory, "..", "..", "pubspec.yaml"])
let pubspecPath = NSString.path(withComponents: [firebaseCoreDirectory, "..", "..", "pubspec.yaml"])
do {
let yamlString = try String(contentsOfFile: pubspecPath, encoding: .utf8)
if let versionLine = yamlString.split(separator: "\n")
Expand All @@ -35,12 +35,8 @@ func loadPubspecVersion() throws -> String {

func loadFirebaseSDKVersion() throws -> String {
let firebaseCoreScriptPath = NSString.path(withComponents: [
iosRootDirectory,
firebaseCoreDirectory,
"..",
"..",
"..",
"firebase_core",
"ios",
"firebase_sdk_version.rb",
])
do {
Expand Down

0 comments on commit 1c1b0ef

Please sign in to comment.