feat: Working on moving commands to cli-client
This commit is contained in:
@@ -36,6 +36,7 @@ struct GenerateProjectTemplateCommand: AsyncParsableCommand {
|
||||
)
|
||||
var extraArgs: [String] = []
|
||||
|
||||
// FIX:
|
||||
mutating func run() async throws {
|
||||
let varsDir = templateVars != nil
|
||||
? ["--extra-vars", "repo_vars_dir=\(templateVars!)"]
|
||||
@@ -43,15 +44,15 @@ struct GenerateProjectTemplateCommand: AsyncParsableCommand {
|
||||
|
||||
let vault = noVault ? ["--extra-vars", "use_vault=false"] : []
|
||||
|
||||
try await runPlaybook(
|
||||
commandName: Self.commandName,
|
||||
globals: globals,
|
||||
extraArgs: extraArgs,
|
||||
[
|
||||
"--tags", "repo-template",
|
||||
"--extra-vars", "output_dir=\(path)"
|
||||
] + varsDir
|
||||
+ vault
|
||||
)
|
||||
// try await runPlaybook(
|
||||
// commandName: Self.commandName,
|
||||
// globals: globals,
|
||||
// extraArgs: extraArgs,
|
||||
// [
|
||||
// "--tags", "repo-template",
|
||||
// "--extra-vars", "output_dir=\(path)"
|
||||
// ] + varsDir
|
||||
// + vault
|
||||
// )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,17 +55,17 @@ struct GenerateConfigurationCommand: AsyncParsableCommand {
|
||||
|
||||
let actualPath: String
|
||||
|
||||
if let path {
|
||||
actualPath = "\(path)/config"
|
||||
} else {
|
||||
let path = "~/.config/hpa-playbook/"
|
||||
try await cliClient.runCommand(
|
||||
quiet: false,
|
||||
shell: globals.shellOrDefault,
|
||||
"mkdir", "-p", path
|
||||
)
|
||||
actualPath = "\(path)/config"
|
||||
}
|
||||
// if let path {
|
||||
// actualPath = "\(path)/config"
|
||||
// } else {
|
||||
// let path = "~/.config/hpa-playbook/"
|
||||
// try await cliClient.runCommand(
|
||||
// quiet: false,
|
||||
// shell: globals.shellOrDefault,
|
||||
// "mkdir", "-p", path
|
||||
// )
|
||||
// actualPath = "\(path)/config"
|
||||
// }
|
||||
|
||||
fatalError()
|
||||
// try cliClient.createConfiguration(actualPath, json)
|
||||
|
||||
Reference in New Issue
Block a user