Skip to content

Commit 739dce1

Browse files
committed
Close the writestream before heading over to untar.
Read failure from status.
1 parent 520e770 commit 739dce1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cp.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ export class Cp {
4040
errStream,
4141
null,
4242
false,
43-
async () => {
44-
if (errStream.size()) {
43+
async ({ status }) => {
44+
writerStream.close();
45+
if (status === 'Failure' || errStream.size()) {
4546
throw new Error(`Error from cpFromPod - details: \n ${errStream.getContentsAsString()}`);
4647
}
4748
await tar.x({

0 commit comments

Comments
 (0)