This commit is contained in:
Trym Lund Flogard 2021-06-02 17:00:08 +02:00
parent e96c1262aa
commit 75e2916679
2 changed files with 435 additions and 424 deletions

851
dist/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -106,10 +106,16 @@ export class NextcloudClient {
const tempArtifactDir = path.join(os.tmpdir(), this.guid);
const artifactPath = path.join(tempArtifactDir, `artifact-${this.artifact}`);
await fs.mkdir(path.join(artifactPath, this.artifact), { recursive: true });
const copies = [];
for (let spec of specs) {
await fs.copyFile(spec.absolutePath, path.join(artifactPath, spec.uploadPath));
const dstpath = path.join(artifactPath, spec.uploadPath);
const promise = fs.mkdir(path.dirname(dstpath))
.then(() => fs.copyFile(spec.absolutePath, dstpath))
copies.push(promise);
}
await Promise.all(copies);
const archivePath = path.join(artifactPath, `${this.artifact}.zip`);
await this.zip(path.join(artifactPath, this.artifact), archivePath);