6.7.0 - Alpha6 - Scrapers 工具的更新机制由 "锚点更新" 替换为 "结构化更新"
This commit is contained in:
@@ -4,7 +4,7 @@ import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import { fetchStatistics } from './fetch-and-parse-autojs6-merged-pr-commits-statistics.mjs';
|
||||
import { objectToLines } from './utils/format.mjs';
|
||||
import { printDifferences } from './utils/print.mjs';
|
||||
import { printLinesDiffs } from './utils/print.mjs';
|
||||
import { toYYYYMMDD } from './utils/date.mjs';
|
||||
|
||||
const updateCommonJsonFile = () => {
|
||||
@@ -22,7 +22,7 @@ const updateCommonJsonFile = () => {
|
||||
if (from !== to) {
|
||||
fs.writeFileSync(commonJsonPath, JSON.stringify(updatedCommon, null, 2), 'utf8');
|
||||
console.log('[common.json] Updated (contribution statistics date)');
|
||||
printDifferences(objectToLines(commonObj), objectToLines(updatedCommon), { regexForKeyMatching: /"\w+"(?=:)/ });
|
||||
printLinesDiffs(objectToLines(commonObj), objectToLines(updatedCommon), { regexForKeyMatching: /"\w+"(?=:)/ });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ const markdownToLines = (md) => {
|
||||
fs.writeFileSync(filePath, updated, { encoding: 'utf-8' });
|
||||
console.log(`[${filename}] Updated (contribution statistics list)`);
|
||||
if (oldMarkdown) {
|
||||
printDifferences(markdownToLines(oldMarkdown), markdownToLines(newMarkdown));
|
||||
printLinesDiffs(markdownToLines(oldMarkdown), markdownToLines(newMarkdown));
|
||||
}
|
||||
updateCommonJsonFile();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user