File tree 3 files changed +31
-2
lines changed
src/main/scala/net/cardnell/mkver
3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -70,9 +70,17 @@ branches: [
70
70
# patches control how files are updated
71
71
patches: [
72
72
{
73
+ # name of the patch, referenced from the branch configs
73
74
name: HelmChart
74
- filePatterns: ["**/Chart.yaml"]
75
+ # files to match, can include glob wildcards
76
+ filePatterns: [
77
+ "**Chart.yaml" # Chart.yaml in current working directory or any subdirectory of the current working directory
78
+ "**/Chart.yaml" # Chart.yaml in any subdirectory of the current working directory
79
+ "Chart.yaml" # Chart.yaml the current working directory only
80
+ ]
81
+ # search string, using java regular expression syntax (https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html)
75
82
find: "appVersion: .*"
83
+ # replacement string using substitutions from formats
76
84
replace: "appVersion: \"{Version}\""
77
85
}
78
86
{
Original file line number Diff line number Diff line change
1
+ # We won't set most of the defaults, the application defaults are fine
2
+ defaults {
3
+ patches: [
4
+ Sbt
5
+ ]
6
+ }
7
+ branches: [
8
+ {
9
+ name: "master"
10
+ tag: true
11
+ tagFormat: Version
12
+ }
13
+ ]
14
+ patches: [
15
+ {
16
+ name: Sbt
17
+ filePatterns: ["build.sbt"]
18
+ find: "version\\s+:=\\s+\".*\""
19
+ replace: "version := \"{Version}\""
20
+ }
21
+ ]
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ class Main(git: Git.Service = Git.Live.git()) {
69
69
val regex = patch.find.r
70
70
val replacement = Formatter (nextVersion, config).format(patch.replace)
71
71
patch.filePatterns.foreach { filePattern =>
72
- File .currentWorkingDirectory.glob(filePattern, includePath = false ).foreach { file =>
72
+ File .currentWorkingDirectory.glob(filePattern, includePath = true ).foreach { file =>
73
73
println(s " patching: $file, replacement: $replacement" )
74
74
val newContent = regex.replaceAllIn(file.contentAsString, replacement)
75
75
file.overwrite(newContent)
You can’t perform that action at this time.
0 commit comments