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

@@ -0,0 +1,41 @@
import Dependencies
import ShellClient
func runVault(
commandName: String,
options: VaultOptions,
_ args: [String]
) async throws {
try await withSetupLogger(commandName: commandName, globals: options.globals) {
@Dependency(\.cliClient) var cliClient
@Dependency(\.logger) var logger
logger.debug("Begin run vault: \(options)")
let configuration = try cliClient.ensuredConfiguration(nil)
logger.debug("Configuration: \(configuration)")
let path: String
if let file = options.file {
path = file
} else {
path = try cliClient.findVaultFileInCurrentDirectory()
}
logger.debug("Vault path: \(path)")
let defaultArgs = configuration.defaultVaultArgs ?? []
try await cliClient.runCommand(
quiet: options.quiet,
shell: options.shellOrDefault,
["ansible-vault"]
+ args
+ defaultArgs
+ options.extraArgs
+ [path]
)
fatalError()
}
}