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