Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resources: Add script to generate changelog #337

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ rules:
import/exports-last: off
import/no-duplicates: error
import/no-namespace: error
import/extensions: [error, never] # TODO: switch to ignorePackages
import/extensions:
- error
- ignorePackages
- ts: never # TODO: remove once TS supports extensions
js: never # TODO: remove
import/order: [error, { newlines-between: always-and-inside-groups }]
import/newline-after-import: error
import/prefer-default-export: off
Expand Down
11 changes: 11 additions & 0 deletions resources/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

const fs = require('fs');
const path = require('path');
const childProcess = require('child_process');

function exec(command, options) {
const output = childProcess.execSync(command, {
maxBuffer: 10 * 1024 * 1024, // 10MB
encoding: 'utf-8',
...options,
});
return output && output.trimEnd();
}

function readdirRecursive(dirPath, opts = {}) {
const { ignoreDir } = opts;
Expand Down Expand Up @@ -71,6 +81,7 @@ function showDirStats(dirPath) {
}

module.exports = {
exec,
readdirRecursive,
showDirStats,
};