Skip to content
This repository was archived by the owner on Jun 14, 2019. It is now read-only.

Commit 422c386

Browse files
committed
chore(build): add automatic github release scriptlet (fixup)
1 parent 8e6782d commit 422c386

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

build_tools/upload-github-release.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ const mkdirSync = function (path) {
1515
throw e;
1616
}
1717
}
18-
}
18+
};
1919

2020
// Find changelog for a specific version
2121
const getChangelog = (changelogFilePath, forVersion) => {
22-
const prefix = '# ';
22+
const prefix = '<a name="';
23+
const skipLines = 1;
2324
return new Promise((resolve) => {
2425
fs.readFile(changelogFilePath, (err, bytes) => {
2526
if (err) {
@@ -31,8 +32,8 @@ const getChangelog = (changelogFilePath, forVersion) => {
3132
let bodyStartIndex = lines.findIndex((str) => str.substr(0, prefix.length + forVersion.length) === `${prefix}${forVersion}`);
3233
if (bodyStartIndex > -1) {
3334
let bodyEndIndex = lines.findIndex((str, idx) => idx > bodyStartIndex && str.substr(0, prefix.length) === prefix);
34-
let header = lines[bodyStartIndex].substring(prefix.length);
35-
let body = lines.slice(bodyStartIndex + 1, bodyEndIndex).join('\n');
35+
let header = forVersion;
36+
let body = lines.slice(bodyStartIndex + 1 + skipLines, bodyEndIndex).join('\n');
3637
resolve({header, body});
3738
} else {
3839
resolve({header : forVersion, body : ''});
@@ -153,7 +154,7 @@ resetTempResources()
153154
.then(([changelog, assets]) => {
154155
return publish({
155156
ghApiToken : process.env.GH_TOKEN,
156-
projectOwner : 'angular-translate',
157+
projectOwner : 'knalli',
157158
projectRepo : process.env.PROJECT_REPO || pkg.name,
158159
projectVersion : pkg.version,
159160
projectVersionName : `${pkg.name} ${changelog.header || pkg.version}`,

0 commit comments

Comments
 (0)