Skip to content

Commit

Permalink
Removed mapper directory
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Jun 10, 2024
1 parent 70d3ac0 commit f6bbad0
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 32 deletions.
3 changes: 0 additions & 3 deletions packages/contentstack-import/src/commands/cm/stacks/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ export default class ImportCommand extends Command {
description: 'Excluded the Module that are branch independent from the import',
default: false
}),
'mapper-dir': flags.string({
description: 'path of backup directory for base branch import',
}),
};

static aliases: string[] = ['cm:import'];
Expand Down
1 change: 0 additions & 1 deletion packages/contentstack-import/src/types/import-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default interface ImportConfig extends DefaultConfig, ExternalConfig {
skipExisting?: boolean;
skipAudit?: boolean;
stackName?: string;
'mapper-dir'?: string;
'exclude-global-modules': false;
}

Expand Down
22 changes: 0 additions & 22 deletions packages/contentstack-import/src/utils/backup-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default async function backupHandler(importConfig: ImportConfig): Promise

if (backupDirPath) {
cliux.print('Copying content to the backup directory...');
await copyMapperFolder(importConfig, backupDirPath);
return new Promise((resolve, reject) => {
return copy(importConfig.contentDir, backupDirPath, (error: any) => {
if (error) {
Expand Down Expand Up @@ -71,24 +70,3 @@ function isSubDirectory(importConfig: ImportConfig) {
// true if both parent and child have same path
return true;
}

/**
*
*/

async function copyMapperFolder(importConfig: ImportConfig, backupDirPath: string) {
try {
const mapperDir = importConfig['mapper-dir'];
if (!mapperDir) {
return;
}
const copyPromises = importConfig.globalModules.map((globalModule: string) =>
copy(`${mapperDir}/mapper/${globalModule}`, `${backupDirPath}/mapper/${globalModule}`),
);
await Promise.all(copyPromises);
return backupDirPath;
} catch (error) {
trace(error, 'error', true);
throw error;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,6 @@ const setupConfig = async (importCmdFlags: any): Promise<ImportConfig> => {
config['exclude-global-modules'] = importCmdFlags['exclude-global-modules'];
}

if (importCmdFlags['mapper-dir'] && importCmdFlags['exclude-global-modules']) {
config['mapper-dir'] = importCmdFlags['mapper-dir'];
} else if (importCmdFlags['exclude-global-modules']) {
config['mapper-dir'] = await askMapperDir();
}

return config;
};

Expand Down

0 comments on commit f6bbad0

Please sign in to comment.