delete temp file after zip

This commit is contained in:
Trym Lund Flogard
2021-11-14 18:42:22 +01:00
parent 62e99ad6b2
commit b357f186aa
3 changed files with 20 additions and 10 deletions

View File

@ -42,11 +42,15 @@ export class NextcloudClient {
const spec = this.uploadSpec(files)
core.info('Zipping files...')
const zip = await this.zipFiles(spec)
core.info('Uploading to Nextcloud...')
const filePath = await this.upload(zip)
core.info(`Remote file path: ${filePath}`)
return await this.shareFile(filePath)
try {
core.info('Uploading to Nextcloud...')
const filePath = await this.upload(zip)
core.info(`Remote file path: ${filePath}`)
return await this.shareFile(filePath)
}
finally {
await fs.unlink(zip)
}
}
private uploadSpec(files: string[]): FileSpec[] {