Skip to content

Commit

Permalink
fixes minor code problems, such as missing semicolons, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha committed Nov 30, 2014
1 parent 1450afd commit 4e5604a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bin/crx.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var join = path.join;

var cwd = process.cwd();

program.version(pkg.version)
program.version(pkg.version);
// coming soon
// .option("-x, --xml", "output autoupdate xml instead of extension ")

Expand Down Expand Up @@ -52,8 +52,8 @@ function keygen (dir, program) {
}

console.log('%s has been generated in %s', 'key.pem', dir);
})
})
});
});
}

function pack (dir, program) {
Expand Down Expand Up @@ -103,4 +103,4 @@ function pack (dir, program) {
return crx.destroy();
});
});
}
}
9 changes: 5 additions & 4 deletions src/crx.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* global require, process, Buffer, module */
'use strict';

var fs = require("fs");
Expand Down Expand Up @@ -39,7 +40,7 @@ function ChromeExtension(attrs) {
this[name] = attrs[name];
}

this.path = join("tmp", "crx-" + (Math.random() * 1e17).toString(36))
this.path = join("tmp", "crx-" + (Math.random() * 1e17).toString(36));
}

ChromeExtension.prototype = {
Expand Down Expand Up @@ -202,7 +203,7 @@ ChromeExtension.prototype = {
var allFiles = [];

if (!selfie.loaded) {
throw new Error('crx.load needs to be called first in order to prepare the workspace.')
throw new Error('crx.load needs to be called first in order to prepare the workspace.');
}

// the callback is called many times
Expand Down Expand Up @@ -265,7 +266,7 @@ ChromeExtension.prototype = {

var crx = new Buffer(length);

crx.write("Cr24" + Array(13).join("\x00"), "binary");
crx.write("Cr24" + new Array(13).join("\x00"), "binary");

crx[4] = 2;
crx.writeUInt32LE(keyLength, 8);
Expand Down Expand Up @@ -308,7 +309,7 @@ ChromeExtension.prototype = {
throw new Error("No URL provided for update.xml.");
}

return Buffer(
return new Buffer(
"<?xml version='1.0' encoding='UTF-8'?>\n" +
"<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>\n" +
" <app appid='" + (this.appId || this.generateAppId()) + "'>\n" +
Expand Down
3 changes: 3 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* global require, __dirname, Buffer */
'use strict';

var fs = require("fs");
var test = require("tape");
var ChromeExtension = require("../");
Expand Down

0 comments on commit 4e5604a

Please sign in to comment.