Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Fix cli duplicate error printing #365

Merged
merged 3 commits into from
May 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dev/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { readdirSync } from 'fs'
import { spawn } from 'child_process'
import { stdout, stderr, stdin } from 'process';

const exec = (command: string, pipe?: boolean) => {
const exec = (command: string, pipe?: boolean, returnOutput?: boolean) => {

console.log(`> ${command}`)

Expand All @@ -32,11 +32,11 @@ const exec = (command: string, pipe?: boolean) => {
return new Promise((resolve, reject) => {
prc.on('close', function (code) {
console.log("")
const output = {
const output = returnOutput ? {
stdout: stdoutData.join(''),
stderr: stderrData.join(''),
code,
}
} : undefined;
if (code === 0) {
resolve(output);
} else {
Expand Down