Skip to content

Commit 0ea457a

Browse files
resources: Add script to generate changelog (#337)
1 parent 724c4e8 commit 0ea457a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.eslintrc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ rules:
119119
import/exports-last: off
120120
import/no-duplicates: error
121121
import/no-namespace: error
122-
import/extensions: [error, never] # TODO: switch to ignorePackages
122+
import/extensions:
123+
- error
124+
- ignorePackages
125+
- ts: never # TODO: remove once TS supports extensions
126+
js: never # TODO: remove
123127
import/order: [error, { newlines-between: always-and-inside-groups }]
124128
import/newline-after-import: error
125129
import/prefer-default-export: off

resources/utils.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
const fs = require('fs');
44
const path = require('path');
5+
const childProcess = require('child_process');
6+
7+
function exec(command, options) {
8+
const output = childProcess.execSync(command, {
9+
maxBuffer: 10 * 1024 * 1024, // 10MB
10+
encoding: 'utf-8',
11+
...options,
12+
});
13+
return output && output.trimEnd();
14+
}
515

616
function readdirRecursive(dirPath, opts = {}) {
717
const { ignoreDir } = opts;
@@ -71,6 +81,7 @@ function showDirStats(dirPath) {
7181
}
7282

7383
module.exports = {
84+
exec,
7485
readdirRecursive,
7586
showDirStats,
7687
};

0 commit comments

Comments
 (0)