diff --git a/lib/index.js b/lib/index.js index 7f3474d..c1072fb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -129,17 +129,24 @@ export default class Now extends EventEmitter { // array has a group of files with the same sha but different path const files = await Promise.all(Array.prototype.concat.apply([], await Promise.all((Array.from(this._files)).map(async ([sha, {data, names}]) => { return await names.map(async name => { - if (this._static && toRelative(name, this._path) !== 'package.json') { - name = this.pathInsideContent(name) - } + let mode + + if (this._static) { + if (toRelative(name, this._path) === 'package.json') { + mode = 33261 + } else { + const st = await (followSymlinks ? stat(name) : lstat(name)) + mode = st.mode - const st = await (followSymlinks ? stat(name) : lstat(name)) + name = this.pathInsideContent(name) + } + } return { sha, size: data.length, file: toRelative(name, this._path), - mode: st.mode + mode } }) }))))