Skip to content

Commit

Permalink
refactor(exposed/series): minor series refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Apr 26, 2019
1 parent e28e931 commit 5061443
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/exposed/series.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface ISeriesOptions extends IExecOptions {
force?: boolean;
}

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export default function series(
commands: string | string[],
options: ISeriesOptions = {}
Expand All @@ -23,15 +24,14 @@ export default function series(
let err: Error | null = null;
for (let command of commands) {
try {
await core.exec(command, args || [], options);
if (!command) throw Error(`No command passed for series`);
await core.exec(command, args || [], false, options);
} catch (e) {
err = e;
if (options.force || options.silent) logger.error(err);
if (!options.force) break;
}
}
if (err) {
if (options.silent) logger.debug(err);
else throw err;
}
if (err && !options.silent) throw err;
};
}

0 comments on commit 5061443

Please sign in to comment.