Closed romankoval closed 5 years ago
Thanks a lot for the PR @romankoval ! I'll take a look within the week.
Thanks @GeKorm.
Would be nice to get it in and build new version of npm as soon as possible, because I don't have possibility to deploy serverless project to AWS without right permissions.
@romankoval Do you have a simple reproduction of the issue so I can test this? I'm asking because Filehound is supposed to return files/directories that exist, so I'm having trouble understanding how fs.existsSync() helps the issue.
@GeKorm actually I cannot share the whole code base, but in webpack config I have the following:
const PermissionsOutputPlugin = require('webpack-permissions-plugin');
...
new PermissionsOutputPlugin({
buildFiles: [
{
path: path.join(__dirname, '.webpack/transcoder/ffmpeg'),
fileMode: '777',
},
{
path: path.join(__dirname, '.webpack/transcoder/ffprobe'),
fileMode: '777',
},
],
}),
transcoder is a separate module that is build as part on serverless framework. There are plenty of separate lambdas that is built individually into separate zip archives but all of them are in the same project. Such as I need ffmpeg only for one module, it's not present in any other modules. The plugin is called on 'done' action for each module and in case if webpacked module doesn't contain the file the plugin fails. fs.existsSync() check if file is not present by webpacked dir 'webpack/...' than chmod is not executed on this path.
Hi @romankoval I published this as @v1.0.2-beta.0
(or @beta
) please let me know if it solves your issue.
@GeKorm It works perfectly.
Thank you!
will you deploy stable version?
@romankoval No, thank you!
So I would like to leave the beta up for at least a week before deploying as a stable version. This change is low risk, but you never know with so many complex build processes out there 😄
While building webpack individually 'done' event is triggered when first package is ready, but in case if wee need to update files included in different package the plugin fails that file doesn't exist.
Added verification if file exists before calling chmod operation.