Skip to content

Commit f9cae98

Browse files
authored
Merge pull request #8 from Automattic/fix/s3
Fix S3
2 parents 29c7cbb + e6588bf commit f9cae98

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

Package.resolved

Lines changed: 2 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ let package = Package(
1212
// Dependencies declare other packages that this package depends on.
1313
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.4.0"),
1414
.package(url: "https://github.com/soto-project/soto.git", from: "5.0.0"),
15+
.package(url: "https://github.com/swift-server/async-http-client.git", "1.5.0"..."1.5.1"), /// This was breaking S3 download, pinned until that's fixed
1516
.package(url: "https://github.com/jkmassel/prlctl.git", from: "1.14.0"),
1617
.package(url: "https://github.com/ebraraktas/swift-tqdm.git", from: "0.1.2"),
1718
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
@@ -25,6 +26,7 @@ let package = Package(
2526
dependencies: [
2627
.product(name: "ArgumentParser", package: "swift-argument-parser"),
2728
.product(name: "SotoS3", package: "soto"),
29+
.product(name: "AsyncHTTPClient", package: "async-http-client"), /// can be removed when we remove the pin above
2830
.product(name: "prlctl", package: "prlctl"),
2931
.product(name: "Tqdm", package: "swift-tqdm"),
3032
.product(name: "Logging", package: "swift-log"),

Sources/hostmgr/helpers/Configuration.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ struct Configuration: Codable {
6161
return self
6262
}
6363

64+
static var isValid: Bool {
65+
let configuration = try? StateManager.getConfiguration()
66+
return configuration != nil
67+
}
68+
6469
@discardableResult
6570
func save() throws -> Configuration {
6671
return try StateManager.write(configuration: self)

Sources/hostmgr/main.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ struct HostMgr: ParsableCommand {
2121

2222
func run() throws {
2323
logger.debug("Starting Up")
24+
25+
guard Configuration.isValid else {
26+
print("Invalid configuration – exiting")
27+
throw ExitCode(1)
28+
}
29+
2430
if version {
2531
print(appVersion)
2632
} else {

0 commit comments

Comments
 (0)