Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Mar 15, 2024
1 parent 7950a6c commit 5d0d1d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/ts/spawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ export const buildSpawnOpts = ({spawnOpts, stdio, cwd, shell, input, env, detach
signal
})

// eslint-disable-next-line sonarjs/cognitive-complexity
export const invoke = (c: TSpawnCtxNormalized): TSpawnCtxNormalized => {
const now = Date.now()
const stdio: TSpawnResult['stdio'] = [c.stdin, c.stdout, c.stderr]
Expand All @@ -116,11 +117,11 @@ export const invoke = (c: TSpawnCtxNormalized): TSpawnCtxNormalized => {
if (c.sync) {
const opts = buildSpawnOpts(c)
const result = c.spawnSync(c.cmd, c.args, opts)
if (result.stdout.length) {
if (result.stdout.length > 0) {
c.stdout.write(result.stdout)
c.ee.emit('stdout', result.stdout, c)
}
if (result.stderr.length) {
if (result.stderr.length > 0) {
c.stderr.write(result.stderr)
c.ee.emit('stderr', result.stderr, c)
}
Expand Down

0 comments on commit 5d0d1d6

Please sign in to comment.