@sodacore/cli
Version:
Sodacore CLI is a plugin that offers CLI functionality within the framework.
12 lines (11 loc) • 499 B
JavaScript
import { Utils } from '@sodacore/di';
export default function Namespace(name, flags) {
return (target) => {
Utils.setMeta('type', 'autowire')(target, 'controller');
Utils.setMeta('namespace', 'cli')(target, name ?? null);
Utils.setMeta('flags', 'cli')(target, flags ?? null);
const services = Utils.getMeta('services', 'controller')(target, undefined, []);
services.push('cli');
Utils.setMeta('services', 'controller')(target, services);
};
}