UNPKG

@pnp/cli-microsoft365

Version:

Manage Microsoft 365 and SharePoint Framework projects on any platform

32 lines 1.07 kB
import { z } from 'zod'; import { cli } from "../../../../cli/cli.js"; import { globalOptionsZod } from "../../../../Command.js"; import { settingsNames } from "../../../../settingsNames.js"; import AnonymousCommand from "../../../base/AnonymousCommand.js"; import commands from "../../commands.js"; const settingNameValues = Object.getOwnPropertyNames(settingsNames); export const options = z.strictObject({ ...globalOptionsZod.shape, key: z.enum(settingNameValues).optional().alias('k') }); class CliConfigResetCommand extends AnonymousCommand { get name() { return commands.CONFIG_RESET; } get description() { return 'Resets the specified CLI configuration option to its default value'; } get schema() { return options; } async commandAction(logger, args) { if (args.options.key) { cli.getConfig().delete(args.options.key); } else { cli.getConfig().clear(); } } } export default new CliConfigResetCommand(); //# sourceMappingURL=config-reset.js.map