This commit is contained in:
Trym Lund Flogard 2021-06-02 19:08:27 +02:00
parent ae39220a7a
commit c38757acba
2 changed files with 725 additions and 723 deletions

1437
dist/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -158,12 +158,13 @@ export class NextcloudClient {
const remoteFilePath = path.join(remoteFileDir, `${this.artifact}.zip`);
core.info("Transferring file...");
fsSync.createReadStream(file)
.pipe(this.davClient.createWriteStream(remoteFilePath))
.on('error', () => core.setFailed("Failed to upload file"))
.on('finish', () => core.info("File upload finished"));
const stream = fsSync.createReadStream(file)
.pipe(this.davClient.createWriteStream(remoteFilePath));
return remoteFilePath;
return await new Promise<string>((resolve, reject) =>{
stream.on('error', () => reject("Failed to upload file"))
.on('finish', () => resolve(remoteFilePath));
});
}
private async shareFile(remoteFilePath: string) {