unity-builder/cli/commands/command-factory.ts

16 lines
381 B
TypeScript

import { NonExistentCommand } from './command/non-existent-command.ts';
import { BuildCommand } from './command/build-command.ts';
export class CommandFactory {
constructor() {}
public createCommand(commandName) {
switch (commandName) {
case 'build':
return new BuildCommand();
default:
return new NonExistentCommand(commandName);
}
}
}