Skip to content

Commit 968ded5

Browse files
committed
wip: start implementing the generate command
1 parent 0d58dc3 commit 968ded5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

lib/commands/generate.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { run } from '@nativescript/schematics-engine';
2+
3+
export class GenerateCommand implements ICommand {
4+
public allowedParameters: ICommandParameter[] = [];
5+
6+
constructor(private $logger: ILogger, private $errors: IErrors) {}
7+
8+
public async execute(args: string[]): Promise<void> {
9+
try {
10+
await run({
11+
logger: this.$logger,
12+
schematic: 'component',
13+
schematicOptions: {
14+
name: 'random',
15+
// project: 'web-mobile-project'
16+
},
17+
directory: process.cwd(),
18+
});
19+
} catch (error) {
20+
this.$errors.failWithoutHelp(error.message);
21+
}
22+
}
23+
}
24+
25+
$injector.registerCommand("generate", GenerateCommand);

0 commit comments

Comments
 (0)