mirror of
https://github.com/trympet/nextcloud-artifacts-action.git
synced 2025-04-24 20:16:08 +02:00
test
This commit is contained in:
parent
6226379dbd
commit
cbff2d05e7
1442
dist/index.js
vendored
1442
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@ -163,15 +163,25 @@ export class NextcloudClient {
|
||||
|
||||
const remoteFilePath = `${remoteFileDir}/${this.artifact}.zip`;
|
||||
core.info(`Transferring file... (${file})`);
|
||||
const stream = this.davClient.createWriteStream(remoteFilePath)
|
||||
fsSync.createReadStream(file)
|
||||
.pipe(stream);
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
stream.on('error', () => reject("Failed to upload file"))
|
||||
const remoteStream = this.davClient.createWriteStream(remoteFilePath);
|
||||
const remoteStreamPromise = new Promise<void>((resolve, reject) => {
|
||||
remoteStream.on('error', () => reject("Failed to upload file"))
|
||||
.on('pipe', () => core.info("pipe"))
|
||||
.on('finish', () => resolve());
|
||||
});
|
||||
|
||||
const fileStream = fsSync.createReadStream(file);
|
||||
const fileStreamPromise = new Promise<void>((resolve, reject) => {
|
||||
fileStream.on('error', () => reject("Failed to read file"))
|
||||
.on('pipe', () => core.info("pipe"))
|
||||
.on('end', () => resolve());
|
||||
});
|
||||
|
||||
fileStream.pipe(remoteStream);
|
||||
|
||||
await Promise.all([remoteStreamPromise, fileStreamPromise]);
|
||||
|
||||
core.info("finish");
|
||||
return remoteFilePath;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user