feat: Adds output values to some of the commands to allow them to be piped into other commands
This commit is contained in:
@@ -68,6 +68,7 @@ struct CreateCommand: AsyncParsableCommand {
|
||||
template: .init(directory: templateDir),
|
||||
useLocalTemplateDirectory: localTemplateDir
|
||||
))
|
||||
print(projectDir)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ struct GenerateProjectTemplateCommand: AsyncParsableCommand {
|
||||
mutating func run() async throws {
|
||||
@Dependency(\.playbookClient) var playbookClient
|
||||
|
||||
try await playbookClient.run.generateTemplate(.init(
|
||||
let output = try await playbookClient.run.generateTemplate(.init(
|
||||
shared: globals.sharedPlaybookRunOptions(
|
||||
commandName: Self.commandName,
|
||||
extraOptions: extraOptions
|
||||
@@ -51,5 +51,7 @@ struct GenerateProjectTemplateCommand: AsyncParsableCommand {
|
||||
templateVarsDirectory: templateVars,
|
||||
useVault: !noVault
|
||||
))
|
||||
|
||||
print(output)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,11 @@ struct DecryptCommand: AsyncParsableCommand {
|
||||
mutating func run() async throws {
|
||||
@Dependency(\.vaultClient) var vaultClient
|
||||
|
||||
try await vaultClient.run(options.runOptions(
|
||||
let output = try await vaultClient.run.decrypt(options.runOptions(
|
||||
commandName: Self.commandName,
|
||||
route: .decrypt,
|
||||
outputFilePath: output
|
||||
))
|
||||
|
||||
print(output)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,11 @@ struct EncryptCommand: AsyncParsableCommand {
|
||||
mutating func run() async throws {
|
||||
@Dependency(\.vaultClient) var vaultClient
|
||||
|
||||
try await vaultClient.run(options.runOptions(
|
||||
let output = try await vaultClient.run.encrypt(options.runOptions(
|
||||
commandName: Self.commandName,
|
||||
route: .encrypt,
|
||||
outputFilePath: output
|
||||
))
|
||||
|
||||
print(output)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,11 +42,9 @@ extension VaultOptions {
|
||||
|
||||
func runOptions(
|
||||
commandName: String,
|
||||
route: VaultClient.RunOptions.Route,
|
||||
outputFilePath: String? = nil
|
||||
) -> VaultClient.RunOptions {
|
||||
.init(
|
||||
route,
|
||||
extraOptions: extraOptions,
|
||||
loggingOptions: .init(
|
||||
commandName: commandName,
|
||||
|
||||
Reference in New Issue
Block a user