Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix S3 #8

Merged
merged 3 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/swift-server/async-http-client.git",
"state": {
"branch": null,
"revision": "d928cc81b31796dcea7378bf7e2519bed569c659",
"version": "1.6.1"
"revision": "8e4d51908dd49272667126403bf977c5c503f78f",
"version": "1.5.0"
}
},
{
Expand Down Expand Up @@ -109,15 +109,6 @@
"version": "1.10.2"
}
},
{
"package": "swift-nio-http2",
"repositoryURL": "https://github.com/apple/swift-nio-http2.git",
"state": {
"branch": null,
"revision": "326f7f9a8c8c8402e3691adac04911cac9f9d87f",
"version": "1.18.4"
}
},
{
"package": "swift-nio-ssl",
"repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
Expand Down
2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ let package = Package(
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/apple/swift-argument-parser", from: "0.4.0"),
.package(url: "https://github.com/soto-project/soto.git", from: "5.0.0"),
.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
.package(url: "https://github.com/jkmassel/prlctl.git", from: "1.14.0"),
.package(url: "https://github.com/ebraraktas/swift-tqdm.git", from: "0.1.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
Expand All @@ -25,6 +26,7 @@ let package = Package(
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
.product(name: "SotoS3", package: "soto"),
.product(name: "AsyncHTTPClient", package: "async-http-client"), /// can be removed when we remove the pin above
.product(name: "prlctl", package: "prlctl"),
.product(name: "Tqdm", package: "swift-tqdm"),
.product(name: "Logging", package: "swift-log"),
Expand Down
5 changes: 5 additions & 0 deletions Sources/hostmgr/helpers/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ struct Configuration: Codable {
return self
}

static var isValid: Bool {
let configuration = try? StateManager.getConfiguration()
return configuration != nil
}

@discardableResult
func save() throws -> Configuration {
return try StateManager.write(configuration: self)
Expand Down
6 changes: 6 additions & 0 deletions Sources/hostmgr/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ struct HostMgr: ParsableCommand {

func run() throws {
logger.debug("Starting Up")

guard Configuration.isValid else {
print("Invalid configuration – exiting")
throw ExitCode(1)
}

if version {
print(appVersion)
} else {
Expand Down