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

Adds option during migrate source to have files in lowercase #322

Merged
merged 1 commit into from
Jan 23, 2024
Merged
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
13 changes: 9 additions & 4 deletions src/views/projectExplorer/migrateSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ interface MigrationConfig {
sourceFiles: string[];
automaticRename: boolean;
fixIncludes: boolean;
importText: boolean
importText: boolean;
lower: boolean;
}

/**
Expand Down Expand Up @@ -101,7 +102,7 @@ export async function migrateSource(iProject: IProject, library: string): Promis

// Run CVTSRCPF
const cvtsrcpfResult = await connection.sendCommand({
command: `export PATH="/QOpenSys/pkgs/bin:$PATH:" && /QOpenSys/pkgs/bin/makei cvtsrcpf ${migrationConfig.defaultCCSID ? `-c ${migrationConfig.defaultCCSID}` : ``} ${migrationConfig.importText ? `-t` : ``} ${sourceFile} ${library}`,
command: `export PATH="/QOpenSys/pkgs/bin:$PATH:" && /QOpenSys/pkgs/bin/makei cvtsrcpf ${migrationConfig.defaultCCSID ? `-c ${migrationConfig.defaultCCSID}` : ``} ${migrationConfig.importText ? `-t` : ``} ${migrationConfig.lower ? `-l` : ``} ${sourceFile} ${library}`,
directory: directoryPath
});

Expand Down Expand Up @@ -224,7 +225,8 @@ export async function getMigrationConfig(iProject: IProject, library: string): P
.addInput(`srcLib`, l10n.t('Source Library'), l10n.t('The name of the library containing the source files to migrate.'), { default: library, readonly: true })
.addInput(`defaultCCSID`, l10n.t('Default CCSID'), l10n.t('The CCSID to be used when the source file is 65535.'), { default: `*JOB`, minlength: 1 })
.addSelect(`workspaceFolder`, l10n.t('Workspace folder'), projectSelectItems, l10n.t('The workspace folder to which the files are to be downloaded to.'))
.addCheckbox(`importText`, l10n.t('Import Member Text'), l10n.t('Imports member text at top of source as comment.'), true);
.addCheckbox(`importText`, l10n.t('Import Member Text'), l10n.t('Imports member text at top of source as comment.'), true)
.addCheckbox(`lower`, l10n.t('Lowercase Filenames'), l10n.t('The generated source file names will be in lowercase.'), true);

// Clean up tab
cleanUpTab
Expand Down Expand Up @@ -267,6 +269,8 @@ export async function getMigrationConfig(iProject: IProject, library: string): P
delete data.fixIncludes;
const importText = data.importText;
delete data.importText;
const lower = data.lower;
delete data.lower;

const sourceFiles = Object.entries<boolean>(data)
.filter(sourceFile => sourceFile[1] === true)
Expand All @@ -278,7 +282,8 @@ export async function getMigrationConfig(iProject: IProject, library: string): P
sourceFiles: sourceFiles,
automaticRename: automaticRename,
fixIncludes: fixIncludes,
importText: importText
importText: importText,
lower: lower
};
}
}
Expand Down
Loading