Skip to content

Commit

Permalink
Merge pull request #116 from depot/feat/log-disk-usage-errors
Browse files Browse the repository at this point in the history
feat: log disk usage errors
  • Loading branch information
goller authored Jul 30, 2024
2 parents cda8311 + 4a0191c commit 9493448
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils/buildkit.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {execa} from 'execa'

export async function du(): Promise<string | undefined> {
const {exitCode, stdout} = await execa(
const {exitCode, stdout, stderr} = await execa(
'/usr/bin/buildctl',
[
'--tlsservername',
Expand All @@ -27,5 +27,9 @@ export async function du(): Promise<string | undefined> {
stdin: 'inherit',
},
)
return exitCode == 0 ? stdout : undefined
if (exitCode !== 0) {
console.error('Unable to get disk usage', stderr)
return undefined
}
return stdout
}

0 comments on commit 9493448

Please sign in to comment.