feat: Begins vault commands, adds nodes for rendering discussion documentation.

This commit is contained in:
2024-11-30 14:41:25 -05:00
parent 2c551e33d3
commit 4b84c19198
19 changed files with 432 additions and 153 deletions

View File

@@ -17,6 +17,7 @@ public struct CliClient: Sendable {
public var loadConfiguration: @Sendable () throws -> Configuration
public var runCommand: @Sendable ([String], Bool, ShellCommand.Shell) async throws -> Void
public var createConfiguration: @Sendable (_ path: String, _ json: Bool) throws -> Void
public var findVaultFileInCurrentDirectory: @Sendable () throws -> String
public func runCommand(
quiet: Bool,
@@ -95,6 +96,11 @@ extension CliClient: DependencyKey {
}
try fileClient.write(path, data)
} findVaultFileInCurrentDirectory: {
guard let url = try fileClient.findVaultFileInCurrentDirectory() else {
throw CliClientError.vaultFileNotFound
}
return path(for: url)
}
}
@@ -107,6 +113,7 @@ extension CliClient: DependencyKey {
enum CliClientError: Error {
case fileExistsAtPath(String)
case vaultFileNotFound
}
private let jsonEncoder: JSONEncoder = {