@pnp/cli-microsoft365
Version:
Manage Microsoft 365 and SharePoint Framework projects on any platform
38 lines • 1.37 kB
JavaScript
import { z } from 'zod';
import { globalOptionsZod } from '../../../Command.js';
import { browserUtil } from '../../../utils/browserUtil.js';
import AnonymousCommand from '../../base/AnonymousCommand.js';
import commands from '../commands.js';
export const options = z.strictObject({
...globalOptionsZod.shape,
type: z.enum(['bug', 'command', 'sample']).alias('t')
});
class CliIssueCommand extends AnonymousCommand {
get name() {
return commands.ISSUE;
}
get description() {
return 'Returns, or opens a URL that takes the user to the right place in the CLI GitHub repo to create a new issue reporting bug, feedback, ideas, etc.';
}
get schema() {
return options;
}
async commandAction(logger, args) {
let issueLink = '';
switch (encodeURIComponent(args.options.type)) {
case 'bug':
issueLink = 'https://aka.ms/cli-m365/bug';
break;
case 'command':
issueLink = 'https://aka.ms/cli-m365/new-command';
break;
case 'sample':
issueLink = 'https://aka.ms/cli-m365/new-sample-script';
break;
}
await browserUtil.open(issueLink);
await logger.log(issueLink);
}
}
export default new CliIssueCommand();
//# sourceMappingURL=cli-issue.js.map