@@ -190,19 +190,29 @@ public final class Project {
190190 }
191191 }
192192
193- func loadCartfile( URL: NSURL ) -> SignalProducer < Cartfile , CarthageError > {
194- return SignalProducer
195- . attempt { Cartfile . fromFile ( URL) }
196- . flatMapError { error -> SignalProducer < Cartfile , CarthageError > in
197- if isNoSuchFileError ( error) {
198- return SignalProducer ( value: Cartfile ( ) )
199- }
200-
201- return SignalProducer ( error: error)
193+ let cartfile = SignalProducer . attempt {
194+ return Cartfile . fromFile ( cartfileURL)
195+ }
196+ . flatMapError { error -> SignalProducer < Cartfile , CarthageError > in
197+ if isNoSuchFileError ( error) && NSFileManager . defaultManager ( ) . fileExistsAtPath ( privateCartfileURL. path!) {
198+ return SignalProducer ( value: Cartfile ( ) )
202199 }
203- }
204200
205- return zip ( loadCartfile ( cartfileURL) , loadCartfile ( privateCartfileURL) )
201+ return SignalProducer ( error: error)
202+ }
203+
204+ let privateCartfile = SignalProducer . attempt {
205+ return Cartfile . fromFile ( privateCartfileURL)
206+ }
207+ . flatMapError { error -> SignalProducer < Cartfile , CarthageError > in
208+ if isNoSuchFileError ( error) {
209+ return SignalProducer ( value: Cartfile ( ) )
210+ }
211+
212+ return SignalProducer ( error: error)
213+ }
214+
215+ return zip ( cartfile, privateCartfile)
206216 . attemptMap { cartfile, privateCartfile -> Result < Cartfile , CarthageError > in
207217 var cartfile = cartfile
208218
0 commit comments