MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / handler

Function handler

src/commands/config/reset.ts:32–45  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

30 }))
31
32const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
33 const command = await smartThingsCommand(argv)
34
35 const message = 'Are you sure you want to clear saved answers to questions' +
36 `${command.profileName === 'default' ? '' : ` for the profile ${command.profileName}`}?`
37 const confirmed = await booleanInput(message, { default: false })
38
39 if (confirmed) {
40 await resetManagedConfig(command.cliConfig, command.profileName)
41 console.log('Configuration has been reset.')
42 } else {
43 console.log('Configuration reset canceled.')
44 }
45}
46
47const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
48export default cmd

Callers

nothing calls this directly

Calls 3

smartThingsCommandFunction · 0.85
booleanInputFunction · 0.85
resetManagedConfigFunction · 0.85

Tested by

no test coverage detected