Files
suwayomi-material-you-webui/tools/scripts/release/createTranslationChangelog.ts

48 lines
1.8 KiB
TypeScript
Raw Normal View History

/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import yargs from 'yargs';
import { hideBin } from 'yargs/helpers';
2025-02-17 02:45:02 +01:00
import { createTranslationChangelog } from './TranslationChangelog.utils.ts';
import { TRANSLATION_CHANGELOG_YARG_OPTIONS_DEFAULT } from '../weblate/Weblate.constants.ts';
2024-05-28 14:24:13 +02:00
const { afterDate, beforeDate, requiredContributionCount, keepKnownContributors } = yargs(hideBin(process.argv))
.options({
afterDate: {
alias: 'ad',
description: 'IS0-8601 formatted date (included) (e.g. 2024-05-01)',
type: 'string',
demandOption: true,
},
beforeDate: {
alias: 'bd',
description: 'IS0-8601 formatted date (excluded) (e.g. 2024-05-11)',
type: 'string',
demandOption: true,
},
requiredContributionCount: {
alias: 'rcc',
description: 'The minimum number of contributions for a language to be considered a contributor',
type: 'number',
default: TRANSLATION_CHANGELOG_YARG_OPTIONS_DEFAULT.requiredContributionCount,
},
keepKnownContributors: {
alias: 'kc',
description: 'Ignore "requiredContributionCount" for known contributors of a language',
type: 'boolean',
default: TRANSLATION_CHANGELOG_YARG_OPTIONS_DEFAULT.keepKnownContributors,
},
})
.parseSync();
if (!afterDate || !beforeDate) {
throw new Error('The timespan (afterDate and beforeDate) has to be passed!');
}
createTranslationChangelog(afterDate, beforeDate, requiredContributionCount, keepKnownContributors).then(console.log);