MCPcopy Index your code
hub / github.com/MALSync/MALSync / start

Function start

webpackConfig/autoUrls.mjs:282–346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280}
281
282async function start() {
283 const args = process.argv.slice(2);
284 const tasks = {
285 voe,
286 vidmoly,
287 mixdrop,
288 zoro,
289 kickassanime,
290 animekai,
291 bato,
292 mangapark,
293 };
294
295 // Lists all jobs to launch in parallel used in autoUrls.yml
296 if (args.includes('--list')) {
297 console.log(JSON.stringify(Object.keys(tasks)));
298 return;
299 }
300
301 const specificTask = args[0];
302 const failedTasks = [];
303 const succeededTasks = [];
304
305 let tasksToRun = tasks;
306 if (specificTask) {
307 if (tasks[specificTask]) {
308 tasksToRun = { [specificTask]: tasks[specificTask] };
309 } else {
310 console.error(`Task "${specificTask}" not found.`);
311 process.exitCode = 1;
312 }
313 }
314
315 for (const key of Object.keys(tasksToRun)) {
316 await tasksToRun[key]()
317 .then(() => succeededTasks.push(key))
318 .catch(e => {
319 console.error(`\n[${key}]:`, e);
320 failedTasks.push(key);
321 if (process.env.GITHUB_ACTIONS) {
322 console.log(`::error title=Task [${key}] Failed::${e.message || e}`);
323 }
324 });
325 }
326
327 if (succeededTasks.length) {
328 if (args) {
329 console.log('\n\x1b[32mTask succeeded:\x1b[0m', succeededTasks.join(', '));
330 } else {
331 console.log('\n\n\x1b[32mTasks succeeded:\x1b[0m', succeededTasks.join(', '));
332 }
333 }
334 if (failedTasks.length) {
335 if (args) {
336 console.log('\n\x1b[31mTask failed:\x1b[0m', failedTasks.join(', '));
337 } else {
338 console.log('\x1b[31mTasks failed:\x1b[0m', failedTasks.join(', '));
339 }

Callers 1

autoUrls.mjsFile · 0.70

Calls 2

keysMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected