Skip to content

Commit

Permalink
Added output override
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Jul 5, 2023
1 parent 2c9de7b commit 8bf9156
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/commands/custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ export default class Custom extends Command {

let commands: string[] = input.commands ??= (input.command as string).split(" ");

const replaceNames = (search, replace) => {
for (let index = 0; index < commands.length; index++) {
commands[index] = commands[index].replaceAll(search, replace);
const replaceNames = (search, replace, prefix?: string) => {
const r = [];
for (const iterator of commands) {
if (prefix && iterator.includes(search)) {
r.push(prefix);
}
r.push(iterator.replaceAll(search, replace));
}
commands = r;
};

const progress = input.progress as ITriggerObject;
Expand All @@ -70,7 +75,7 @@ export default class Custom extends Command {
filePath
};

replaceNames(key, `-y ${filePath}`);
replaceNames(key, filePath, "-y");
continue;
}
if (key.startsWith("input")) {
Expand Down

0 comments on commit 8bf9156

Please sign in to comment.