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

Function listConfigs

src/commands/config.ts:73–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 return { name, profile: config[name] }
72 }
73 const listConfigs = async (): Promise<ProfileWithName[]> => {
74 const config = command.cliConfig.mergedProfiles
75 const list = Object.keys(config).map(it => {
76 return { name: it, profile: config[it] }
77 })
78 // This is a little iffy since we could end up updating `listTableFieldDefinitions`
79 // more than once if `listConfigs` is called more than once but we don't. (We actively
80 // avoid calling it multiple times in functions we pass it too because they usually get
81 // passed functions that make API calls.)
82 if (argv.verbose && list.some(baseURLValue)) {
83 listTableFieldDefinitions.push({ label: 'API URL', value: baseURLValue })
84 }
85 return list
86 }
87
88 if (argv.name) {
89 const profileName = await stringTranslateToId(outputListConfig, argv.name, listConfigs)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected