Browse Source

Fix file mode passing for regular deployments (#214)

Commit bbf1b30c4d broke file modes
for regular deployments as file mode isn't retrieved anymore.
master
Olli Vanhoja 8 years ago
committed by Leo Lamprecht
parent
commit
0b4660158a
  1. 12
      lib/index.js

12
lib/index.js

@ -128,18 +128,24 @@ module.exports = class Now extends EventEmitter {
// Flatten the array to contain files to sync where each nested input
// 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}]) => {
const statFn = followSymlinks ? stat : lstat
return await names.map(async name => {
let mode
const getMode = async () => {
const st = await statFn(name)
return st.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
mode = await getMode()
name = this.pathInsideContent(name)
}
} else {
mode = await getMode()
}
return {

Loading…
Cancel
Save