Skip to content

Commit

Permalink
Merge pull request #406 from trivir/feature/command-refactor
Browse files Browse the repository at this point in the history
Command Refactor: Update Mock Naming
  • Loading branch information
vscheuber authored May 7, 2024
2 parents 54d3bb3 + c00b4eb commit 90eaccc
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/utils/SetupPollyForFrodoLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,32 @@ function getFrodoCommand({ state }: { state: State }) {
'/' +
getFrodoArgsId({ start: 2, state });
} else {
cmd = process.argv[2] + '/' + getFrodoArgsId({ start: 3, state });
cmd = process.argv[2] + '/';
let i = 3;
if (cmd === 'info/') {
cmd += getFrodoArgsId({ start: 3, state });
} else {
if (
process.argv[i] === 'export' ||
process.argv[i] === 'import' ||
process.argv[i] === 'list' ||
process.argv[i] === 'delete' ||
process.argv[i] === 'count' ||
process.argv[i] === 'describe' ||
process.argv[i] === 'enable' ||
process.argv[i] === 'disable'
) {
cmd += process.argv[i++] + '/';
}
let firstParamIndex = process.argv.findIndex((a) => a.startsWith('-'));
firstParamIndex =
firstParamIndex === -1 ? process.argv.length : firstParamIndex;
cmd += process.argv.slice(i, firstParamIndex).join('-');
if (!cmd.endsWith('/')) {
cmd += '/';
}
cmd += getFrodoArgsId({ start: firstParamIndex, state });
}
}
} catch (error) {
printMessage({
Expand Down

0 comments on commit 90eaccc

Please sign in to comment.