We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7bb0be1 commit eb6a5ccCopy full SHA for eb6a5cc
cli/src/commands/grpc-service/index.ts
@@ -1,5 +1,6 @@
1
import { Command } from 'commander';
2
import { BaseCommandOptions } from '../../core/types/types.js';
3
+import { checkAuth } from '../auth/utils.js';
4
import generateCommand from './commands/generate.js';
5
import initCommand from './commands/init.js';
6
import listTemplatesCommand from './commands/list-templates.js';
@@ -17,5 +18,12 @@ export default (opts: BaseCommandOptions) => {
17
18
command.addCommand(publishCommand(opts));
19
command.addCommand(deleteCommand(opts));
20
21
+ command.hook('preAction', async (thisCmd) => {
22
+ if (['generate', 'init', 'list-templates'].includes(thisCmd.args[0])) {
23
+ return;
24
+ }
25
+ await checkAuth();
26
+ });
27
+
28
return command;
29
};
0 commit comments