Skip to content

Commit

Permalink
adjust
Browse files Browse the repository at this point in the history
  • Loading branch information
omochi committed Dec 21, 2022
1 parent 6ddd898 commit 11a817c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Plugins/CodegenKitPlugin/CodegenKitPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PackagePlugin
@main
struct CodegenKitPlugin: CommandPlugin {
func performCommand(context: PluginContext, arguments: [String]) async throws {
let tool = try context.tool(named: "codegenkit")
let tool = try context.tool(named: "codegen-kit")

let process = EasyProcess(
path: URL(fileURLWithPath: tool.path.string),
Expand Down
22 changes: 14 additions & 8 deletions Sources/CodegenKitCLI/Commands.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import Foundation
import ArgumentParser
import CodegenKit

public struct CodegenKitCommand: ParsableCommand {
public static var configuration = CommandConfiguration(
public func main() {
CodegenKitCommand.main()
}

struct CodegenKitCommand: ParsableCommand {
static var configuration = CommandConfiguration(
commandName: "codegen-kit",
abstract: "CodegenKit CLI tool",
version: CodegenKit.Module.version,
Expand All @@ -11,18 +16,19 @@ public struct CodegenKitCommand: ParsableCommand {
]
)

public init() {}
init() {}
}

public struct InitCommand: ParsableCommand {
public static var configuration = CommandConfiguration(
struct InitCommand: ParsableCommand {
static var configuration = CommandConfiguration(
commandName: "init",
abstract: "Initialize codegen"
)

public init() {}
init() {}

public mutating func run() {
print("init!")
mutating func run() throws {
let initializer = RepositoryInitializer(directory: URL(fileURLWithPath: "."))
try initializer.run()
}
}
2 changes: 1 addition & 1 deletion Sources/codegen-kit/main.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Foundation
import CodegenKitCLI
CodegenKitCLI.main()

CodegenKitCommand.main()

0 comments on commit 11a817c

Please sign in to comment.