Removed require() alignment and added Egyptian casing ;-)
This commit is contained in:
parent
b32e9b6b39
commit
683a518448
1 changed files with 7 additions and 10 deletions
17
pack.js
17
pack.js
|
@ -1,10 +1,10 @@
|
||||||
var constants = require('constants')
|
var constants = require('constants')
|
||||||
var eos = require('end-of-stream')
|
var eos = require('end-of-stream')
|
||||||
var util = require('util')
|
var util = require('util')
|
||||||
|
|
||||||
var Readable = require('readable-stream').Readable
|
var Readable = require('readable-stream').Readable
|
||||||
var PassThrough = require('readable-stream').PassThrough
|
var PassThrough = require('readable-stream').PassThrough
|
||||||
var Writable = require('readable-stream').Writable
|
var Writable = require('readable-stream').Writable
|
||||||
|
|
||||||
var headers = require('./headers')
|
var headers = require('./headers')
|
||||||
|
|
||||||
|
@ -19,8 +19,7 @@ var overflow = function(self, size) {
|
||||||
if (size) self.push(END_OF_TAR.slice(0, 512 - size))
|
if (size) self.push(END_OF_TAR.slice(0, 512 - size))
|
||||||
}
|
}
|
||||||
|
|
||||||
function mode2type(mode)
|
function mode2type(mode) {
|
||||||
{
|
|
||||||
switch (mode & constants.S_IFMT) {
|
switch (mode & constants.S_IFMT) {
|
||||||
case constants.S_IFBLK: return 'block-device'
|
case constants.S_IFBLK: return 'block-device'
|
||||||
case constants.S_IFCHR: return 'character-device'
|
case constants.S_IFCHR: return 'character-device'
|
||||||
|
@ -117,13 +116,11 @@ Pack.prototype.entry = function(header, buffer, callback) {
|
||||||
var stream = new Writable
|
var stream = new Writable
|
||||||
var linkname = ''
|
var linkname = ''
|
||||||
|
|
||||||
stream._write = function(data, enc, cb)
|
stream._write = function(data, enc, cb) {
|
||||||
{
|
|
||||||
linkname += data
|
linkname += data
|
||||||
cb()
|
cb()
|
||||||
}
|
}
|
||||||
eos(stream, function(err)
|
eos(stream, function(err) {
|
||||||
{
|
|
||||||
if (err) { // stream was closed
|
if (err) { // stream was closed
|
||||||
self.destroy()
|
self.destroy()
|
||||||
return callback(err)
|
return callback(err)
|
||||||
|
|
Loading…
Reference in a new issue