-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(toolkit): preserve asset's files mode #3413
Conversation
@aereal can you check if the solution proposed here #3145 (comment) preserves file mode (using |
@jogold Sorry I missed that issue, I'll check that. |
The issue is not about file mode but we are trying there to change the implementation of |
@@ -4,6 +4,18 @@ import fs = require('fs-extra'); | |||
import glob = require('glob'); | |||
import path = require('path'); | |||
|
|||
const appendFiles = async (directory: string, files: string[], archive: archiver.Archiver): Promise<void> => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather declare this as async function appendFiles(directory: string, files: string[], archive: archiver.Archiver): Promise<void> { /*...*/ }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tslint tells me that async function
violates non-arrow-function
rule if function
keyword used.
Even so should I do?
Fmm... I cannot reproduce failed test cases locally. |
To preserve file order using `archiver` files must be appended serially either using stream or buffer (appending by file path does not preserve order even when done serially). Appending using buffer seems to be the only way to solve `EMFILE` errors. Call `fs.stat` before appending to preserve mode. Closes aws#3145, Closes aws#3344, Closes aws#3413
To preserve file order using `archiver` files must be appended serially either using stream or buffer (appending by file path does not preserve order even when done serially). Appending using buffer seems to be the only way to solve `EMFILE` errors. Call `fs.stat` before appending to preserve mode. Closes #3145, Closes #3344, Closes #3413
The original file/directory permission (a.k.a. mode) of asset's files are lost since #2931 merged.
This problem breaks deployment of Lambda using
Code.asset
because compiled binary in the asset lacks executable bit.After this P-R,
zipDirectory
passmode
argument that obtained fromfs.stat
.Pull Request Checklist
design
folderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license