feat: Begins vault commands, adds nodes for rendering discussion documentation.
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user