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

16 lines
381 B
TypeScript
Raw Normal View History

2022-04-23 21:17:35 +00:00
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);
}
}
}