Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
3debb882
Commit
3debb882
authored
Nov 17, 2020
by
Francisco Giordano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix changelog versioning to include date only after final release
(cherry picked from commit
d3a4e31f
)
parent
25ac3348
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
update-changelog-release-date.js
scripts/release/update-changelog-release-date.js
+8
-10
No files found.
scripts/release/update-changelog-release-date.js
View file @
3debb882
...
...
@@ -18,21 +18,19 @@ const changelog = fs.readFileSync('CHANGELOG.md', 'utf8');
const
pkg
=
require
(
'../../package.json'
);
const
version
=
pkg
.
version
.
replace
(
new
RegExp
(
'-'
+
suffix
+
'
\\
..*'
),
''
);
const
unreleased
=
/^## Unreleased$/im
;
const
released
=
new
RegExp
(
`^##
${
version
}
\\([-\\d]*\\)$`
,
'm'
);
const
header
=
new
RegExp
(
`^## (Unreleased|
${
version
}
)$`
,
'm'
);
if
(
released
.
test
(
changelog
))
{
process
.
exit
(
0
);
}
if
(
!
unreleased
.
test
(
changelog
))
{
if
(
!
header
.
test
(
changelog
))
{
console
.
error
(
'Missing changelog entry'
);
process
.
exit
(
1
);
}
fs
.
writeFileSync
(
'CHANGELOG.md'
,
changelog
.
replace
(
unreleased
,
`##
${
version
}
(
${
new
Date
().
toISOString
().
split
(
'T'
)[
0
]}
)`
),
const
newHeader
=
pkg
.
version
.
indexOf
(
suffix
)
===
-
1
?
`##
${
version
}
(
${
new
Date
().
toISOString
().
split
(
'T'
)[
0
]}
)`
:
`##
${
version
}
`
;
fs
.
writeFileSync
(
'CHANGELOG.md'
,
changelog
.
replace
(
header
,
newHeader
)
);
cp
.
execSync
(
'git add CHANGELOG.md'
,
{
stdio
:
'inherit'
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment