Skip to content

Commit 42e6618

Browse files
sunil-lakshmanharshithad0703
authored andcommitted
Merge branch 'development' into enh/dx-2196
1 parent a16b1b9 commit 42e6618

File tree

1 file changed

+3
-5
lines changed
  • packages/contentstack-import/src/commands/cm/stacks

1 file changed

+3
-5
lines changed

packages/contentstack-import/src/commands/cm/stacks/import.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,9 @@ export default class ImportCommand extends Command {
181181
}
182182
}
183183

184-
// Set backupDir early so it's available in error handling
185-
backupDir = importConfig.backupDir;
186-
187184
const moduleImporter = new ModuleImporter(managementAPIClient, importConfig);
188185
const result = await moduleImporter.start();
186+
backupDir = importConfig.backupDir;
189187

190188
if (!result?.noSuccessMsg) {
191189
const successMessage = importConfig.stackName
@@ -199,8 +197,8 @@ export default class ImportCommand extends Command {
199197
} catch (error) {
200198
handleAndLogError(error);
201199
log.info(`The log has been stored at '${getLogPath()}'`);
202-
if (backupDir) {
203-
log.info(`The backup content has been stored at '${backupDir}'`);
200+
if (importConfig?.backupDir) {
201+
log.info(`The backup content has been stored at '${importConfig?.backupDir}'`);
204202
} else {
205203
log.info('No backup directory was created due to early termination');
206204
}

0 commit comments

Comments
 (0)