Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS-43741-handled why logs where not created in mentioned path #1289

Merged
merged 5 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions packages/contentstack-export/src/commands/cm/stacks/export.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default class ExportCommand extends Command {
static aliases: string[] = ['cm:export'];

async run(): Promise<void> {
let exportDir: string;
let exportDir: string = path.join(process.cwd(), 'logs');
try {
const { flags } = await this.parse(ExportCommand);
let exportConfig = await setupExportConfig(flags);
Expand All @@ -115,13 +115,7 @@ export default class ExportCommand extends Command {
log(exportConfig, `The log has been stored at '${path.join(exportDir, 'logs', 'export')}'`, 'success');
} catch (error) {
log({ data: exportDir } as ExportConfig, `Failed to export stack content - ${formatError(error)}`, 'error');
log(
{ data: exportDir } as ExportConfig,
`The log has been stored at ${
exportDir ? path.join(exportDir, 'logs', 'export') : path.join(__dirname, 'logs')
cs-raj marked this conversation as resolved.
Show resolved Hide resolved
}`,
'info',
);
log({ data: exportDir } as ExportConfig, `The log has been stored at ${exportDir}`, 'info');
}
}
}
2 changes: 1 addition & 1 deletion packages/contentstack-export/src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function init(_logPath: string) {
}

export const log = async (config: ExportConfig, message: any, type: string) => {
const logsPath = config.data || __dirname;
const logsPath = config.data;
cs-raj marked this conversation as resolved.
Show resolved Hide resolved
// ignoring the type argument, as we are not using it to create a logfile anymore
if (type !== 'error') {
// removed type argument from init method
Expand Down
Loading