Browse Source

Set a default file mode for package.json

master
Leo Lamprecht 8 years ago
parent
commit
bbf1b30c4d
No known key found for this signature in database GPG Key ID: B08517883D5E0E10
  1. 17
      lib/index.js

17
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 // 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}]) => {
return await names.map(async name => { return await names.map(async name => {
if (this._static && toRelative(name, this._path) !== 'package.json') { let mode
name = this.pathInsideContent(name)
} 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 { return {
sha, sha,
size: data.length, size: data.length,
file: toRelative(name, this._path), file: toRelative(name, this._path),
mode: st.mode mode
} }
}) })
})))) }))))

Loading…
Cancel
Save