From 6fcf949979289b7cdd58c8a4692ce69bf6be2aab Mon Sep 17 00:00:00 2001 From: Andrew Barba Date: Tue, 3 Mar 2015 00:08:14 -0500 Subject: [PATCH] add support for Node.js 0.12 and io.js 1.4 --- CHANGELOG.md | 11 +++++++++++ lib/pass.js | 25 ++++++++++--------------- package.json | 7 +++---- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7afe079..895ea8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 2.1.0 March 2, 2015 + +Add support for Node.js 0.12 and io.js 1.4 + +Fix failing image tests on Node.js 0.12 and io.js 1.4 + +Fix failing signature check on Node.js 0.12 and io.js 1.4 + +Remove unused async dependency + + ## 2.0.1 November 14, 2012 Fix addImage not working with buffers. diff --git a/lib/pass.js b/lib/pass.js index bd385f8..5193dfd 100644 --- a/lib/pass.js +++ b/lib/pass.js @@ -256,15 +256,15 @@ Pass.prototype.pipe = function(output) { self.emit("error", lastError); } else { process.nextTick(function() { - self.signZip(zip, manifest, function(error) { - zip.close(); - zip.on("end", function() { - self.emit("end"); - }); - zip.on("error", function(error) { - self.emit("error", error); - }); - }); + self.signZip(zip, manifest, function(error) { + zip.close(); + zip.on("end", function() { + self.emit("end"); + }); + zip.on("error", function(error) { + self.emit("error", error); + }); + }); }); } } @@ -354,7 +354,7 @@ function signManifest(template, manifest, callback) { var sign = execFile("openssl", args, { stdio: "pipe" }, function(error, stdout, stderr) { var trimmedStderr = stderr.trim(); // Windows outputs some unhelpful error messages, but still produces a valid signature - if (error || trimmedStderr != null && trimmedStderr != "Loading 'screen' into random state - done" && trimmedStderr != "Loading 'screen' into random state - done\r\nunable to write 'random state'") { + if (error || (trimmedStderr && trimmedStderr.indexOf('- done') < 0)) { callback(new Error(stderr)); } else { var signature = stdout.split(/\n\n/)[3]; @@ -393,11 +393,6 @@ function SHAWriteStream(manifest, filename, output) { this.sha = Crypto.createHash("sha1"); output.on("close", this.emit.bind(this, "close")); output.on("error", this.emit.bind(this, "error")); - var self = this; - this.on("pipe", function(source) { - source.on("data", self.write.bind(self)); - source.resume(); - }); } inherits(SHAWriteStream, Stream); diff --git a/package.json b/package.json index a8d791d..e984ca1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "passbook", "description": "iOS Passbook for the Node hacker", "homepage": "https://github.com/assaf/node-passbook", - "version": "2.0.3", + "version": "2.1.0", "author": { "name": "Assaf Arkin", "email": "assaf@labnotes.org" @@ -11,11 +11,10 @@ "node-passbook": "./bin/node-passbook" }, "dependencies": { - "async": "0.2.9", - "cli": "0.4.5" + "cli": "0.6.5" }, "devDependencies": { - "mocha": "1.12.0" + "mocha": "2.1.0" }, "scripts": { "test": "mocha"