Skip to content

Commit 1ae5e54

Browse files
committed
feat: Suppress noisy 'bootstrap.js' setup output
1 parent d80ec89 commit 1ae5e54

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

.github/actions/file/bootstrap.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import fs from 'node:fs'
55
import * as url from 'node:url'
66
import { spawn } from 'node:child_process'
77

8-
function spawnPromisified(command, args, options) {
8+
function spawnPromisified(command, args, { quiet = false, ...options } = {}) {
99
return new Promise((resolve, reject) => {
1010
const proc = spawn(command, args, options)
1111
proc.stdout.setEncoding('utf8')
1212
proc.stdout.on('data', (data) => {
13-
console.log(data)
13+
if (!quiet) {
14+
console.log(data)
15+
}
1416
})
1517
proc.stderr.setEncoding('utf8')
1618
proc.stderr.on('data', (data) => {
@@ -36,7 +38,8 @@ await (async () => {
3638
} catch {
3739
try {
3840
await spawnPromisified('npm', ['ci'], {
39-
cwd: url.fileURLToPath(new URL('.', import.meta.url))
41+
cwd: url.fileURLToPath(new URL('.', import.meta.url)),
42+
quiet: true
4043
})
4144
} catch {
4245
process.exit(1)
@@ -45,7 +48,8 @@ await (async () => {
4548
// Compile TypeScript.
4649
try {
4750
await spawnPromisified('npm', ['run', 'build'], {
48-
cwd: url.fileURLToPath(new URL('.', import.meta.url))
51+
cwd: url.fileURLToPath(new URL('.', import.meta.url)),
52+
quiet: true
4953
})
5054
} catch {
5155
process.exit(1)

.github/actions/find/bootstrap.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import fs from 'node:fs'
55
import * as url from 'node:url'
66
import { spawn } from 'node:child_process'
77

8-
function spawnPromisified(command, args, options) {
8+
function spawnPromisified(command, args, { quiet = false, ...options } = {}) {
99
return new Promise((resolve, reject) => {
1010
const proc = spawn(command, args, options)
1111
proc.stdout.setEncoding('utf8')
1212
proc.stdout.on('data', (data) => {
13-
console.log(data)
13+
if (!quiet) {
14+
console.log(data)
15+
}
1416
})
1517
proc.stderr.setEncoding('utf8')
1618
proc.stderr.on('data', (data) => {
@@ -36,7 +38,8 @@ await (async () => {
3638
} catch {
3739
try {
3840
await spawnPromisified('npm', ['ci'], {
39-
cwd: url.fileURLToPath(new URL('.', import.meta.url))
41+
cwd: url.fileURLToPath(new URL('.', import.meta.url)),
42+
quiet: true
4043
})
4144
} catch {
4245
process.exit(1)
@@ -45,7 +48,8 @@ await (async () => {
4548
// Compile TypeScript.
4649
try {
4750
await spawnPromisified('npm', ['run', 'build'], {
48-
cwd: url.fileURLToPath(new URL('.', import.meta.url))
51+
cwd: url.fileURLToPath(new URL('.', import.meta.url)),
52+
quiet: true
4953
})
5054
} catch {
5155
process.exit(1)

.github/actions/fix/bootstrap.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import fs from 'node:fs'
55
import * as url from 'node:url'
66
import { spawn } from 'node:child_process'
77

8-
function spawnPromisified(command, args, options) {
8+
function spawnPromisified(command, args, { quiet = false, ...options } = {}) {
99
return new Promise((resolve, reject) => {
1010
const proc = spawn(command, args, options)
1111
proc.stdout.setEncoding('utf8')
1212
proc.stdout.on('data', (data) => {
13-
console.log(data)
13+
if (!quiet) {
14+
console.log(data)
15+
}
1416
})
1517
proc.stderr.setEncoding('utf8')
1618
proc.stderr.on('data', (data) => {
@@ -36,7 +38,8 @@ await (async () => {
3638
} catch {
3739
try {
3840
await spawnPromisified('npm', ['ci'], {
39-
cwd: url.fileURLToPath(new URL('.', import.meta.url))
41+
cwd: url.fileURLToPath(new URL('.', import.meta.url)),
42+
quiet: true
4043
})
4144
} catch {
4245
process.exit(1)
@@ -45,7 +48,8 @@ await (async () => {
4548
// Compile TypeScript.
4649
try {
4750
await spawnPromisified('npm', ['run', 'build'], {
48-
cwd: url.fileURLToPath(new URL('.', import.meta.url))
51+
cwd: url.fileURLToPath(new URL('.', import.meta.url)),
52+
quiet: true
4953
})
5054
} catch {
5155
process.exit(1)

0 commit comments

Comments
 (0)