Skip to content

Commit ce31f81

Browse files
committed
fix: handle cli.json copy upon pull to empty dir
1 parent 84a8c92 commit ce31f81

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/amplify-provider-awscloudformation/src/attach-backend.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,9 @@ async function downloadBackend(context, backendEnv, awsConfig) {
258258
absolute: true,
259259
});
260260
const amplifyDir = pathManager.getAmplifyDirPath();
261+
const isPulling = context.input.command === 'pull' || (context.input.command === 'env' && context.input.subCommands[0] === 'pull');
261262

262-
if (context.exeInfo && context.exeInfo.restoreBackend) {
263+
if ((context.exeInfo && context.exeInfo.restoreBackend) || isPulling) {
263264
// If backend must be restored then copy out the config files and overwrite existing ones.
264265
for (const cliJSONFilePath of cliJSONFiles) {
265266
const targetPath = path.join(amplifyDir, path.basename(cliJSONFilePath));

0 commit comments

Comments
 (0)