2023-08-11 17:23:56 +02:00
|
|
|
/*
|
|
|
|
|
* 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';
|
2025-02-09 23:19:51 +01:00
|
|
|
import { hideBin } from 'yargs/helpers';
|
2025-02-17 02:45:02 +01:00
|
|
|
import { createCommitChangelog } from './CommitChangelog.utils.ts';
|
2023-08-11 17:23:56 +02:00
|
|
|
|
2025-02-09 23:19:51 +01:00
|
|
|
const { sha } = yargs(hideBin(process.argv))
|
2023-08-11 17:23:56 +02:00
|
|
|
.options({
|
|
|
|
|
sha: {
|
|
|
|
|
description: 'The hash of the last commit of the previous release',
|
|
|
|
|
type: 'string',
|
|
|
|
|
demandOption: true,
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
.parseSync();
|
|
|
|
|
|
2024-02-02 18:59:57 +01:00
|
|
|
if (!sha) {
|
|
|
|
|
throw new Error('Sha of last commit of the previous release has to be passed!');
|
|
|
|
|
}
|
2023-12-13 23:48:35 +01:00
|
|
|
|
2025-02-09 23:34:40 +01:00
|
|
|
createCommitChangelog(sha)
|
|
|
|
|
.then(console.log)
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
console.error('Failed due to', error);
|
|
|
|
|
process.exit(1);
|
|
|
|
|
});
|