Skip to content

Commit 9493448

Browse files
authored
Merge pull request #116 from depot/feat/log-disk-usage-errors
feat: log disk usage errors
2 parents cda8311 + 4a0191c commit 9493448

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils/buildkit.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {execa} from 'execa'
22

33
export async function du(): Promise<string | undefined> {
4-
const {exitCode, stdout} = await execa(
4+
const {exitCode, stdout, stderr} = await execa(
55
'/usr/bin/buildctl',
66
[
77
'--tlsservername',
@@ -27,5 +27,9 @@ export async function du(): Promise<string | undefined> {
2727
stdin: 'inherit',
2828
},
2929
)
30-
return exitCode == 0 ? stdout : undefined
30+
if (exitCode !== 0) {
31+
console.error('Unable to get disk usage', stderr)
32+
return undefined
33+
}
34+
return stdout
3135
}

0 commit comments

Comments
 (0)