mirror of
https://github.com/trympet/nextcloud-artifacts-action.git
synced 2025-04-28 13:46:09 +02:00
test
This commit is contained in:
parent
5b01b7a17b
commit
d873964202
1439
dist/index.js
vendored
1439
dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
@ -140,13 +140,15 @@ export class NextcloudClient {
|
|||||||
|
|
||||||
private async zip(dirpath: string, destpath: string) {
|
private async zip(dirpath: string, destpath: string) {
|
||||||
const archive = archiver.create('zip', { zlib: { level: 9 } });
|
const archive = archiver.create('zip', { zlib: { level: 9 } });
|
||||||
const stream = fsSync.createWriteStream(destpath);
|
const stream = archive.directory(dirpath, false)
|
||||||
archive.directory(dirpath, false)
|
.pipe(fsSync.createWriteStream(destpath));
|
||||||
.on('error', e => Promise.reject())
|
|
||||||
.on('close', () => Promise.resolve())
|
|
||||||
.pipe(stream);
|
|
||||||
|
|
||||||
return archive.finalize();
|
await archive.finalize();
|
||||||
|
|
||||||
|
return await new Promise<void>((resolve, reject) => {
|
||||||
|
stream.on('error', e => reject(e))
|
||||||
|
.on('finish', () => resolve());
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
private async upload(file: string) {
|
private async upload(file: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user