mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 00:29:09 +08:00
updating append and directory zips
This commit is contained in:
parent
13d981a863
commit
e71ddb9e5a
@ -56,13 +56,27 @@ export async function createZipUploadStream(
|
|||||||
for (const file of uploadSpecification) {
|
for (const file of uploadSpecification) {
|
||||||
if (file.sourcePath !== null) {
|
if (file.sourcePath !== null) {
|
||||||
// Add a normal file to the zip
|
// Add a normal file to the zip
|
||||||
zip.append(createReadStream(file.sourcePath), {
|
// zip.append(createReadStream(file.sourcePath), {
|
||||||
name: file.destinationPath
|
// name: file.destinationPath
|
||||||
})
|
// })
|
||||||
|
zip.entry(
|
||||||
|
createReadStream(file.sourcePath),
|
||||||
|
{name: file.destinationPath},
|
||||||
|
function (err, entry) {
|
||||||
|
core.debug(`Entry is: ${entry}`)
|
||||||
|
if (err) throw err
|
||||||
|
}
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
|
zip.entry(null, {name: file.destinationPath}, function (err, entry) {
|
||||||
|
core.debug(`Entry is: ${entry}`)
|
||||||
|
if (err) throw err
|
||||||
|
})
|
||||||
// Add a directory to the zip
|
// Add a directory to the zip
|
||||||
zip.append('', {name: file.destinationPath})
|
// zip.append('', {name: file.destinationPath})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zip.finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
const bufferSize = getUploadChunkSize()
|
const bufferSize = getUploadChunkSize()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user