Skip to content

Commit a7b2e78

Browse files
Merge pull request #264 from contentstack/fix/dx-7895-import-setup-backup-folder-path
Fix/dx 7895 import setup backup folder path
2 parents 33c2959 + c2c6b63 commit a7b2e78

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{}
1+
{
2+
"IMPORT_SETUP_SUCCESS": "Backup folder and mapper files have been successfully created for the stack using the API key %s.",
3+
"IMPORT_SETUP_BACKUP_PATH": "The backup folder has been created at '%s'."
4+
}

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

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,23 @@ export default class ImportSetupCommand extends Command {
9898

9999
CLIProgressManager.printGlobalSummary();
100100

101-
log.success(
102-
`Backup folder and mapper files have been successfully created for the stack using the API key ${importSetupConfig.apiKey}.`,
103-
importSetupConfig.context,
104-
);
105-
log.success(
106-
`The backup folder has been created at '${pathValidator(path.join(importSetupConfig.backupDir))}'.`,
107-
importSetupConfig.context,
101+
const successMessage = messageHandler.parse('IMPORT_SETUP_SUCCESS', importSetupConfig.apiKey);
102+
const backupPathMessage = messageHandler.parse(
103+
'IMPORT_SETUP_BACKUP_PATH',
104+
pathValidator(path.join(importSetupConfig.backupDir)),
108105
);
106+
107+
log.success(successMessage, importSetupConfig.context);
108+
log.success(backupPathMessage, importSetupConfig.context);
109+
110+
// log.success maps to the info level, which is suppressed on the console for
111+
// progress-supported modules when showConsoleLogs is false. Print the backup
112+
// folder path directly so it is always visible, regardless of that setting.
113+
const showConsoleLogs = configHandler.get('log')?.showConsoleLogs ?? false;
114+
if (!showConsoleLogs) {
115+
cliux.print(successMessage);
116+
cliux.print(backupPathMessage);
117+
}
109118
} catch (error) {
110119
CLIProgressManager.printGlobalSummary();
111120
handleAndLogError(error);

0 commit comments

Comments
 (0)