2023-03-19 17:37:07 +02:00
|
|
|
import { execCommand } from '@joplin/utils';
|
2021-12-19 09:53:19 +02:00
|
|
|
import { chdir } from 'process';
|
2023-03-19 17:37:07 +02:00
|
|
|
import { rootDir, gitRepoCleanTry } from './tool-utils';
|
2021-12-19 09:53:19 +02:00
|
|
|
import updateDownloadPage from './website/updateDownloadPage';
|
|
|
|
|
|
|
|
async function main() {
|
|
|
|
const doGitOperations = false;
|
|
|
|
|
|
|
|
if (doGitOperations) {
|
|
|
|
await gitRepoCleanTry();
|
2023-03-19 17:37:07 +02:00
|
|
|
await execCommand(['git', 'pull', '--rebase']);
|
2021-12-19 09:53:19 +02:00
|
|
|
}
|
|
|
|
|
2023-03-19 17:37:07 +02:00
|
|
|
await execCommand(['node', `${rootDir}/packages/tools/update-readme-download.js`]);
|
|
|
|
await execCommand(['node', `${rootDir}/packages/tools/build-release-stats.js`, '--types=changelog']);
|
|
|
|
await execCommand(['node', `${rootDir}/packages/tools/build-release-stats.js`, '--types=stats', '--update-interval=30']);
|
|
|
|
await execCommand(['node', `${rootDir}/packages/tools/update-readme-sponsors.js`]);
|
|
|
|
await execCommand(['node', `${rootDir}/packages/tools/build-welcome.js`]);
|
2021-12-19 09:53:19 +02:00
|
|
|
chdir(rootDir);
|
2023-03-19 17:37:07 +02:00
|
|
|
await execCommand(['yarn', 'run', 'buildApiDoc']);
|
2021-12-19 09:53:19 +02:00
|
|
|
await updateDownloadPage();
|
|
|
|
|
|
|
|
if (doGitOperations) {
|
2023-03-19 17:37:07 +02:00
|
|
|
await execCommand(['git', 'add', '-A']);
|
|
|
|
await execCommand(['git', 'commit', '-m', 'Update Markdown doc']);
|
|
|
|
await execCommand(['git', 'pull', '--rebase']);
|
|
|
|
await execCommand(['git', 'push']);
|
2021-12-19 09:53:19 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
main().catch((error) => {
|
|
|
|
console.error('Fatal error', error);
|
|
|
|
process.exit(1);
|
|
|
|
});
|