feat: Working create command.

This commit is contained in:
2024-11-29 18:55:00 -05:00
parent 58e0f0e4b5
commit 84b002c997
8 changed files with 332 additions and 60 deletions

View File

@@ -8,13 +8,14 @@ struct BuildCommand: AsyncParsableCommand {
static let configuration = CommandConfiguration.playbookCommandConfiguration(
commandName: commandName,
abstract: "Build a home performance assesment project."
abstract: "Build a home performance assesment project.",
examples: (label: "Build Project", example: "\(commandName) /path/to/project")
)
@OptionGroup var globals: GlobalOptions
@Argument(
help: "The project directory.",
help: "Path to the project directory.",
completion: .directory
)
var projectDir: String
@@ -25,11 +26,12 @@ struct BuildCommand: AsyncParsableCommand {
var extraArgs: [String] = []
mutating func run() async throws {
let args = [
try await runPlaybook(
commandName: Self.commandName,
globals: globals,
extraArgs: extraArgs,
"--tags", "build-project",
"--extra-vars", "project_dir=\(projectDir)"
] + extraArgs
try await runPlaybook(commandName: Self.commandName, globals: globals, args: args)
)
}
}