Skip to content

Commit

Permalink
Merge 69edf01 into b6e7421
Browse files Browse the repository at this point in the history
  • Loading branch information
evandcoleman authored Dec 1, 2021
2 parents b6e7421 + 69edf01 commit 2e47ea6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/Scipio/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ extension Command {
.init(
commandName: "Scipio",
abstract: "A program to pre-build and cache Swift packages",
version: "0.2.4",
version: "0.2.5",
subcommands: [
Command.Run.self,
Command.Build.self,
Expand Down
14 changes: 10 additions & 4 deletions Sources/ScipioKit/Cache Engines/CacheEngineDelegator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ extension CacheEngineDelegator {
.setFailureType(to: Error.self)
.flatMap(maxPublishers: .max(1)) { artifact -> AnyPublisher<CachedArtifact, Error> in
return self.exists(artifact: artifact)
.flatMap { exists -> AnyPublisher<CachedArtifact, Error> in
.tryFlatMap { exists -> AnyPublisher<CachedArtifact, Error> in
if !exists || force {
log.info("☁️ Uploading \(artifact.name)...")

Expand All @@ -151,9 +151,15 @@ extension CacheEngineDelegator {
return self.put(artifact: artifact)
}
} else {
return Just(CachedArtifact(name: artifact.name, parentName: artifact.parentName, url: self.downloadUrl(for: artifact)))
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
if let compressed = artifact.base as? CompressedArtifact {
return Just(try CachedArtifact(name: artifact.name, parentName: artifact.parentName, url: self.downloadUrl(for: artifact), localPath: compressed.path))
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
} else {
return Just(CachedArtifact(name: artifact.name, parentName: artifact.parentName, url: self.downloadUrl(for: artifact)))
.setFailureType(to: Error.self)
.eraseToAnyPublisher()
}
}
}
.eraseToAnyPublisher()
Expand Down

0 comments on commit 2e47ea6

Please sign in to comment.