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`;
|
const remoteFilePath = `${remoteFileDir}/${this.artifact}.zip`;
|
||||||
core.info(`Transferring file... (${file})`);
|
core.info(`Transferring file... (${file})`);
|
||||||
const stream = this.davClient.createWriteStream(remoteFilePath)
|
|
||||||
fsSync.createReadStream(file)
|
|
||||||
.pipe(stream);
|
|
||||||
|
|
||||||
await new Promise<void>((resolve, reject) => {
|
const remoteStream = this.davClient.createWriteStream(remoteFilePath);
|
||||||
stream.on('error', () => reject("Failed to upload file"))
|
const remoteStreamPromise = new Promise<void>((resolve, reject) => {
|
||||||
|
remoteStream.on('error', () => reject("Failed to upload file"))
|
||||||
.on('pipe', () => core.info("pipe"))
|
.on('pipe', () => core.info("pipe"))
|
||||||
.on('finish', () => resolve());
|
.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");
|
core.info("finish");
|
||||||
return remoteFilePath;
|
return remoteFilePath;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user