Skip to content

Commit f85e9bc

Browse files
Do not require auth for app config use
1 parent e3bd57a commit f85e9bc

File tree

1 file changed

+8
-10
lines changed
  • packages/app/src/cli/commands/app/config

1 file changed

+8
-10
lines changed

packages/app/src/cli/commands/app/config/use.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import {appFlags} from '../../../flags.js'
22
import {checkFolderIsValidApp} from '../../../models/app/loader.js'
3-
import {linkedAppContext} from '../../../services/app-context.js'
3+
import {localAppContext} from '../../../services/app-context.js'
44
import use from '../../../services/app/config/use.js'
5-
import AppLinkedCommand, {AppLinkedCommandOutput} from '../../../utilities/app-linked-command.js'
5+
import AppUnlinkedCommand, {AppUnlinkedCommandOutput} from '../../../utilities/app-unlinked-command.js'
66
import {Args} from '@oclif/core'
77
import {globalFlags} from '@shopify/cli-kit/node/cli'
88

99
// This is one of the few commands where we don't need a
1010
// `--config` flag, because we're passing it as an argument.
1111
const {config, ...appFlagsWithoutConfig} = appFlags
1212

13-
export default class ConfigUse extends AppLinkedCommand {
13+
export default class ConfigUse extends AppUnlinkedCommand {
1414
static summary = 'Activate an app configuration.'
1515

1616
static descriptionWithMarkdown = `Sets default configuration when you run app-related CLI commands. If you omit the \`config-name\` parameter, then you'll be prompted to choose from the configuration files in your project.`
@@ -32,19 +32,17 @@ export default class ConfigUse extends AppLinkedCommand {
3232
}),
3333
}
3434

35-
public async run(): Promise<AppLinkedCommandOutput> {
35+
public async run(): Promise<AppUnlinkedCommandOutput> {
3636
const {flags, args} = await this.parse(ConfigUse)
3737

38-
await checkFolderIsValidApp(flags.path)
39-
await use({directory: flags.path, configName: args.config, reset: flags.reset})
40-
41-
const {app} = await linkedAppContext({
38+
const app = await localAppContext({
4239
directory: flags.path,
43-
clientId: undefined,
44-
forceRelink: false,
4540
userProvidedConfigName: args.config,
4641
})
4742

43+
await checkFolderIsValidApp(flags.path)
44+
await use({directory: flags.path, configName: args.config, reset: flags.reset})
45+
4846
return {app}
4947
}
5048
}

0 commit comments

Comments
 (0)