Skip to content

Commit

Permalink
fix filtering condition
Browse files Browse the repository at this point in the history
  • Loading branch information
imairi committed Feb 10, 2021
1 parent 957089c commit 2b4f017
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct CreateComponentExtension: Command {
child: String) {
targetDirectory = setting.targetDirectory
templateDirectory = setting.templateDirectory
needsCreateTargetFile = paths.filter({ $0.contains("\(parent)Component+\(child).swift") }).isEmpty
needsCreateTargetFile = paths.filter({ $0.contains("/\(parent)Component+\(child).swift") }).isEmpty

self.parent = parent
self.child = child
Expand Down
12 changes: 6 additions & 6 deletions Sources/RIBsCodeGen/Commands/DependencyCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,27 @@ struct DependencyCommand: Command {
self.parent = parent
self.child = child

guard let parentInteractorPath = paths.filter({ $0.contains(parent + "Interactor.swift") }).first else {
guard let parentInteractorPath = paths.filter({ $0.contains("/" + parent + "Interactor.swift") }).first else {
fatalError("Not found \(parent)Interactor.swift".red.bold)
}

guard let parentRouterPath = paths.filter({ $0.contains(parent + "Router.swift") }).first else {
guard let parentRouterPath = paths.filter({ $0.contains("/" + parent + "Router.swift") }).first else {
fatalError("Not found \(parent)Router.swift".red.bold)
}

guard let parentBuilderPath = paths.filter({ $0.contains(parent + "Builder.swift") }).first else {
guard let parentBuilderPath = paths.filter({ $0.contains("/" + parent + "Builder.swift") }).first else {
fatalError("Not found \(parent)Builder.swift".red.bold)
}

guard let childInteractorPath = paths.filter({ $0.contains(child + "Interactor.swift") }).first else {
guard let childInteractorPath = paths.filter({ $0.contains("/" + child + "Interactor.swift") }).first else {
fatalError("Not found \(child)Interactor.swift".red.bold)
}

guard let childRouterPath = paths.filter({ $0.contains(child + "Router.swift") }).first else {
guard let childRouterPath = paths.filter({ $0.contains("/" + child + "Router.swift") }).first else {
fatalError("Not found \(child)Router.swift".red.bold)
}

guard let childBuilderPath = paths.filter({ $0.contains(child + "Builder.swift") }).first else {
guard let childBuilderPath = paths.filter({ $0.contains("/" + child + "Builder.swift") }).first else {
fatalError("Not found \(child)Builder.swift".red.bold)
}

Expand Down

0 comments on commit 2b4f017

Please sign in to comment.