diff --git a/.changeset/thirty-kings-add.md b/.changeset/thirty-kings-add.md new file mode 100644 index 00000000000..65ce6b346b8 --- /dev/null +++ b/.changeset/thirty-kings-add.md @@ -0,0 +1,5 @@ +--- +'@shopify/app': patch +--- + +Fix issue when using `--reset` not creating a new config toml file diff --git a/packages/app/src/cli/services/app-context.test.ts b/packages/app/src/cli/services/app-context.test.ts index 3ad3004b985..04d42d4175f 100644 --- a/packages/app/src/cli/services/app-context.test.ts +++ b/packages/app/src/cli/services/app-context.test.ts @@ -220,7 +220,7 @@ describe('linkedAppContext', () => { }) // Then - expect(link).toHaveBeenCalledWith({directory: tmp, apiKey: undefined, configName: 'shopify.app.toml'}) + expect(link).toHaveBeenCalledWith({directory: tmp, apiKey: undefined, configName: undefined}) }) }) diff --git a/packages/app/src/cli/services/app-context.ts b/packages/app/src/cli/services/app-context.ts index 06e6eb4248a..71017d9c8d5 100644 --- a/packages/app/src/cli/services/app-context.ts +++ b/packages/app/src/cli/services/app-context.ts @@ -59,7 +59,9 @@ export async function linkedAppContext({ // If the app is not linked, force a link. if (configState.state === 'template-only' || forceRelink) { - const result = await link({directory, apiKey: clientId, configName: configState.configurationFileName}) + // If forceRelink is true, we don't want to use the cached config name and instead prompt the user for a new one. + const configName = forceRelink ? undefined : configState.configurationFileName + const result = await link({directory, apiKey: clientId, configName}) remoteApp = result.remoteApp configState = result.state }