mirror of
https://github.com/MbinOrg/mbin-website.git
synced 2025-07-16 06:58:59 +00:00
Add more info to log (stdout) output (#5)
This commit is contained in:
parent
252c1a0ed6
commit
4d89867120
1 changed files with 9 additions and 3 deletions
|
@ -1,5 +1,7 @@
|
|||
import fs from 'node:fs/promises';
|
||||
|
||||
console.info('Creating the output directory');
|
||||
|
||||
await fs.rm('./.output/data', { recursive: true, force: true });
|
||||
await fs.mkdir('./.output/data', { recursive: true });
|
||||
|
||||
|
@ -26,6 +28,8 @@ const fetchReleases = async () => {
|
|||
return output.sort((a, b) => a.publishedAt - b.publishedAt);
|
||||
};
|
||||
|
||||
console.info('Fetching the latest Mbin releases');
|
||||
|
||||
const releases = await fetchReleases();
|
||||
fs.writeFile('./.output/data/releases.json', JSON.stringify(releases), 'utf8');
|
||||
|
||||
|
@ -97,7 +101,7 @@ const fetchServerList = async () => {
|
|||
* @returns {Promise<import('./routes/servers').Server>}
|
||||
*/
|
||||
const fetchServerInfo = async (domain) => {
|
||||
console.log('START:', domain);
|
||||
console.info('START:', domain);
|
||||
|
||||
let jsonNodeInfo;
|
||||
try {
|
||||
|
@ -163,7 +167,7 @@ const fetchServerInfo = async (domain) => {
|
|||
api: apiOutput,
|
||||
};
|
||||
|
||||
console.log('FINISH:', domain);
|
||||
console.info('FINISH:', domain);
|
||||
|
||||
return output;
|
||||
};
|
||||
|
@ -183,7 +187,7 @@ const initServerData = async () => {
|
|||
})
|
||||
.map((v) => v.value);
|
||||
|
||||
console.log('Mbin servers found:', serversJson.length);
|
||||
console.info('Mbin servers found:', serversJson.length);
|
||||
|
||||
fs.writeFile(
|
||||
'./.output/data/servers.json',
|
||||
|
@ -192,4 +196,6 @@ const initServerData = async () => {
|
|||
);
|
||||
};
|
||||
|
||||
console.info('Start init server data');
|
||||
await initServerData();
|
||||
console.info('Done')
|
||||
|
|
Loading…
Add table
Reference in a new issue