feat: Breaking out more dependencies.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import ConfigurationClient
|
||||
import Dependencies
|
||||
import FileClient
|
||||
import ShellClient
|
||||
|
||||
func runVault(
|
||||
@@ -9,7 +10,8 @@ func runVault(
|
||||
) async throws {
|
||||
try await withSetupLogger(commandName: commandName, globals: options.globals) {
|
||||
@Dependency(\.cliClient) var cliClient
|
||||
@Dependency(\.configuration) var configurationClient
|
||||
@Dependency(\.configurationClient) var configurationClient
|
||||
@Dependency(\.fileClient) var fileClient
|
||||
@Dependency(\.logger) var logger
|
||||
|
||||
logger.debug("Begin run vault: \(options)")
|
||||
@@ -21,7 +23,10 @@ func runVault(
|
||||
if let file = options.file {
|
||||
path = file
|
||||
} else {
|
||||
path = try cliClient.findVaultFileInCurrentDirectory()
|
||||
guard let url = try await fileClient.findVaultFileInCurrentDirectory() else {
|
||||
throw VaultFileNotFound()
|
||||
}
|
||||
path = url.cleanFilePath
|
||||
}
|
||||
|
||||
logger.debug("Vault path: \(path)")
|
||||
@@ -48,3 +53,5 @@ func runVault(
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
struct VaultFileNotFound: Error {}
|
||||
|
||||
Reference in New Issue
Block a user