Skip to content

Commit b588a5b

Browse files
committed
🐛 fix: how to read hbs template
1 parent 724e4ab commit b588a5b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

.releaserc.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
const path = require('path');
2-
const { promisify } = require('util');
2+
const fs = require('fs');
33
const dateFormat = require('dateformat');
4-
const readFileAsync = promisify(require('fs').readFile);
54

6-
// Given a `const` variable `TEMPLATE_DIR` which points to "<semantic-release-gitmoji>/lib/assets/templates"
7-
8-
// the *.hbs template and partials should be passed as strings of contents
9-
const template = readFileAsync(path.join(TEMPLATE_DIR, 'release-notes.hbs'));
10-
const commitTemplate = readFileAsync(
11-
path.join(TEMPLATE_DIR, 'commit-template.hbs')
12-
);
5+
const template = path.resolve(__dirname, 'release-notes.hbs');
136

147
module.exports = {
158
plugins: [
@@ -19,11 +12,10 @@ module.exports = {
1912
releaseRules: {
2013
major: [':boom:'],
2114
minor: [':sparkles:'],
22-
patch: [':bug:', ':ambulance:', ':lock:']
15+
patch: [':bug:', ':package:']
2316
},
2417
releaseNotes: {
25-
template,
26-
partials: { commitTemplate },
18+
template: fs.readFileSync(template, 'utf8'),
2719
helpers: {
2820
datetime: function (format = 'UTC:yyyy-mm-dd') {
2921
return dateFormat(new Date(), format);

0 commit comments

Comments
 (0)