Skip to content

Commit

Permalink
Resolve copy promises
Browse files Browse the repository at this point in the history
  • Loading branch information
sjawhar authored Nov 20, 2024
1 parent 04a4dc5 commit 5340328
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class Cp {
const writerStream = fs.createWriteStream(tmpFileName);
const errStream = new WritableStreamBuffer();
return new Promise<void>((resolve, reject) => {
this.execInstance
const conn = await this.execInstance
.exec(
namespace,
podName,
Expand Down Expand Up @@ -67,6 +67,9 @@ export class Cp {
},
)
.catch(reject);
conn.onclose = (event) => {
resolve();
};
});
}

Expand All @@ -92,7 +95,7 @@ export class Cp {
const readStream = fs.createReadStream(tmpFileName);
const errStream = new WritableStreamBuffer();
return new Promise<void>((resolve, reject) => {
this.execInstance
const conn = await this.execInstance
.exec(
namespace,
podName,
Expand All @@ -116,6 +119,9 @@ export class Cp {
},
)
.catch(reject);
conn.onclose = (event) => {
resolve();
};
});
}
}

0 comments on commit 5340328

Please sign in to comment.