mirror of
https://github.com/serverless/serverless.git
synced 2026-02-01 16:07:28 +00:00
Merge pull request #6705 from noreabu/fix-zipService-executable-flag-win32-golang
Fix: use normalized maps in zipService.js
This commit is contained in:
commit
438e1edb42
@ -87,7 +87,10 @@ module.exports = {
|
||||
output.on('open', () => {
|
||||
zip.pipe(output);
|
||||
|
||||
// normalize both maps to avoid problems with e.g. Path Separators in different shells
|
||||
const normalizedFiles = _.uniq(files.map(file => path.normalize(file)));
|
||||
const normalizedFilesToChmodPlusX =
|
||||
filesToChmodPlusX && _.uniq(filesToChmodPlusX.map(file => path.normalize(file)));
|
||||
|
||||
return BbPromise.all(normalizedFiles.map(this.getFileContentAndStat.bind(this)))
|
||||
.then(contents => {
|
||||
@ -95,8 +98,8 @@ module.exports = {
|
||||
const name = file.filePath.slice(prefix ? `${prefix}${path.sep}`.length : 0);
|
||||
let mode = file.stat.mode;
|
||||
if (
|
||||
filesToChmodPlusX &&
|
||||
_.includes(filesToChmodPlusX, name) &&
|
||||
normalizedFilesToChmodPlusX &&
|
||||
_.includes(normalizedFilesToChmodPlusX, name) &&
|
||||
file.stat.mode % 2 === 0
|
||||
) {
|
||||
mode += 1;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user