cli/ts/mod_meta/index.ts
2024-06-21 19:48:43 +02:00

27 lines
771 B
TypeScript

import * as plugins from './meta.plugins.js';
import * as paths from '../paths.js';
import { Meta } from './meta.classes.meta.js';
import { logger } from '../gitzone.logging.js';
export const run = async (argvArg) => {
const command = argvArg._[1];
const metaInstance = new Meta(paths.cwd);
switch (true) {
case command === 'update':
await metaInstance.updateLocalRepos();
break;
case command === 'add':
await metaInstance.addProject(argvArg._[2], argvArg._[3]);
break;
case command === 'remove':
await metaInstance.removeProject(argvArg._[2]);
break;
case command === 'init':
await metaInstance.initProject();
break;
default:
logger.log('error', `You have to specify a command!`);
}
};