Skip to content

Commit e1370de

Browse files
agilgur5swyxio
authored andcommitted
(refactor): invert if in run function (#404)
- better readability / changeability
1 parent ec0f285 commit e1370de

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/index.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,16 +365,15 @@ prog
365365
let successKiller: Killer = null;
366366
let failureKiller: Killer = null;
367367

368-
function run(command: string) {
369-
if (command) {
370-
const [exec, ...args] = command.split(' ');
371-
372-
return execa(exec, args, {
373-
stdio: 'inherit',
374-
});
368+
function run(command?: string) {
369+
if (!command) {
370+
return null;
375371
}
376372

377-
return null;
373+
const [exec, ...args] = command.split(' ');
374+
return execa(exec, args, {
375+
stdio: 'inherit',
376+
});
378377
}
379378

380379
function killHooks() {

0 commit comments

Comments
 (0)