File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/contentstack-import/src/commands/cm/stacks Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments