Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Special support for Mergify config changes #113

Merged
merged 19 commits into from
Mar 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Because this is new, it is still up to a human to identify the pull request as p

### Hub

You need to have Hub installed, see <https://hub.github.com/>.
You need to have `hub` installed, see <https://hub.github.com/>.

### Project forks

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/2.7.x.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ templatecontrol {
copy = [
{ path = "/LICENSE", template = "LICENSE" },
{ path = "/NOTICE", template = "NOTICE" },
{ path = "/.mergify.yml", template = ".mergify.yml" },
{ path = "/.github/settings.yml", template = "settings.yml" },
{
path = "/.travis.yml",
Expand Down
10 changes: 9 additions & 1 deletion src/main/scala/templatecontrol/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package templatecontrol

import better.files.File
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import net.ceedubs.ficus.Ficus._
import net.ceedubs.ficus.readers.ArbitraryTypeReader._
import net.ceedubs.ficus.readers.ValueReader
Expand Down Expand Up @@ -35,7 +36,14 @@ final case class TemplateControlConfig(
github: GithubConfig,
branchConfigs: Seq[BranchConfig],
noPush: Boolean = false,
)
noPr: Boolean = false,
) {
def branchConfigFor(branchName: String): BranchConfig = {
branchConfigs
.find(_.name == branchName)
.getOrElse(BranchConfig(branchName, ConfigFactory.parseString("{ copy = [], finders = [] }")))
}
}

object TemplateControlConfig {

Expand Down
3 changes: 2 additions & 1 deletion src/main/scala/templatecontrol/GitProject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ trait GitProject {
def branches(): Seq[Ref]
def createBranch(branchName: String, startPoint: String): Ref
def checkout(branchName: String): Ref
def fastForward(remote: String, branchName: String): MergeResult
def add(): DirCache
def commit(message: String): RevCommit
def branchCreate(branchName: String): Ref
def push(name: String, force: Boolean = false): Iterable[PushResult]
def push(remote: String, name: String, force: Boolean = false): Iterable[PushResult]
def status(): Status
def log(): Iterable[RevCommit]
def close(): Unit
Expand Down
20 changes: 0 additions & 20 deletions src/main/scala/templatecontrol/RunLagom.scala

This file was deleted.

20 changes: 0 additions & 20 deletions src/main/scala/templatecontrol/RunPlay.scala

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/scala/templatecontrol/Task.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class CopyTask(c: Config) extends Task {
}

def execute(workingDir: File): Seq[TaskResult] = {
val repoName = workingDir.path.getFileName.toString
val repoName = workingDir.name
copyConfigs.filter(c => !c.exclude.contains(repoName)).flatMap { c =>
val source: File = findTemplate(c.template)
val dest: File = file"${workingDir.path.toAbsolutePath}${c.path}"
Expand Down
Loading