Skip to content

Commit af2d3f1

Browse files
committed
build: don`t update version in CHANGELOG.md
1 parent 6839124 commit af2d3f1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

build/change-version.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ function walkAsync(directory, excludedDirectories, fileCallback, errback) {
5555
})
5656
}
5757

58-
function replaceRecursively(directory, excludedDirectories, allowedExtensions, original, replacement) {
58+
// eslint-disable-next-line max-params
59+
function replaceRecursively(directory, excludedDirectories, excludedFiles, allowedExtensions, original, replacement) {
5960
original = new RegExp(regExpQuote(original), 'g')
6061
replacement = regExpQuoteReplacement(replacement)
6162
const updateFile = DRY_RUN ?
@@ -67,7 +68,7 @@ function replaceRecursively(directory, excludedDirectories, allowedExtensions, o
6768
}
6869
} :
6970
filepath => {
70-
if (allowedExtensions.has(path.parse(filepath).ext)) {
71+
if (allowedExtensions.has(path.parse(filepath).ext) && !excludedFiles.has(path.parse(filepath).base)) {
7172
sh.sed('-i', original, replacement, filepath)
7273
}
7374
}
@@ -94,6 +95,9 @@ function main(args) {
9495
'node_modules',
9596
'resources'
9697
])
98+
const EXCLUDED_FILES = new Set([
99+
'CHANGELOG.md'
100+
])
97101
const INCLUDED_EXTENSIONS = new Set([
98102
// This extension allowlist is how we avoid modifying binary files
99103
'',
@@ -106,7 +110,7 @@ function main(args) {
106110
'.txt',
107111
'.yml'
108112
])
109-
replaceRecursively('.', EXCLUDED_DIRS, INCLUDED_EXTENSIONS, oldVersion, newVersion)
113+
replaceRecursively('.', EXCLUDED_DIRS, EXCLUDED_FILES, INCLUDED_EXTENSIONS, oldVersion, newVersion)
110114
}
111115

112116
main(process.argv.slice(2))

0 commit comments

Comments
 (0)