commit
2aa0e69c6e
2 changed files with 2 additions and 2 deletions
|
@ -166,7 +166,7 @@ exports.encode = function(opts) {
|
||||||
if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null
|
if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null
|
||||||
|
|
||||||
buf.write(name)
|
buf.write(name)
|
||||||
buf.write(encodeOct(opts.mode & 07777, 6), 100)
|
buf.write(encodeOct(opts.mode & parseInt('07777', 8), 6), 100)
|
||||||
buf.write(encodeOct(opts.uid, 6), 108)
|
buf.write(encodeOct(opts.uid, 6), 108)
|
||||||
buf.write(encodeOct(opts.gid, 6), 116)
|
buf.write(encodeOct(opts.gid, 6), 116)
|
||||||
buf.write(encodeOct(opts.size, 11), 124)
|
buf.write(encodeOct(opts.size, 11), 124)
|
||||||
|
|
2
pack.js
2
pack.js
|
@ -118,7 +118,7 @@ Pack.prototype.entry = function(header, buffer, callback) {
|
||||||
|
|
||||||
if (!header.size) header.size = 0
|
if (!header.size) header.size = 0
|
||||||
if (!header.type) header.type = modeToType(header.mode)
|
if (!header.type) header.type = modeToType(header.mode)
|
||||||
if (!header.mode) header.mode = header.type === 'directory' ? 0755 : 0644
|
if (!header.mode) header.mode = parseInt(header.type === 'directory' ? '0755' : '0644')
|
||||||
if (!header.uid) header.uid = 0
|
if (!header.uid) header.uid = 0
|
||||||
if (!header.gid) header.gid = 0
|
if (!header.gid) header.gid = 0
|
||||||
if (!header.mtime) header.mtime = new Date()
|
if (!header.mtime) header.mtime = new Date()
|
||||||
|
|
Loading…
Reference in a new issue