feat: Breaking out more dependencies.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import ConfigurationClient
|
||||
import Dependencies
|
||||
import ShellClient
|
||||
|
||||
@@ -8,11 +9,12 @@ func runVault(
|
||||
) async throws {
|
||||
try await withSetupLogger(commandName: commandName, globals: options.globals) {
|
||||
@Dependency(\.cliClient) var cliClient
|
||||
@Dependency(\.configuration) var configurationClient
|
||||
@Dependency(\.logger) var logger
|
||||
|
||||
logger.debug("Begin run vault: \(options)")
|
||||
|
||||
let configuration = try cliClient.ensuredConfiguration(nil)
|
||||
let configuration = try await configurationClient.findAndLoad()
|
||||
logger.debug("Configuration: \(configuration)")
|
||||
|
||||
let path: String
|
||||
@@ -24,7 +26,7 @@ func runVault(
|
||||
|
||||
logger.debug("Vault path: \(path)")
|
||||
|
||||
let defaultArgs = configuration.defaultVaultArgs ?? []
|
||||
let defaultArgs = configuration.vault.args ?? []
|
||||
|
||||
var vaultArgs = ["ansible-vault"]
|
||||
+ args
|
||||
@@ -34,7 +36,7 @@ func runVault(
|
||||
|
||||
if args.contains("encrypt"),
|
||||
!vaultArgs.contains("--encrypt-vault-id"),
|
||||
let id = configuration.defaultVaultEncryptId
|
||||
let id = configuration.vault.encryptId
|
||||
{
|
||||
vaultArgs.append(contentsOf: ["--encrypt-vault-id", id])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user