Skip to content

Commit

Permalink
Merge pull request #26 from joscha/minor-fixes
Browse files Browse the repository at this point in the history
fixes minor code problems, such as missing semicolons, etc.
  • Loading branch information
Thomas Parisot committed Dec 18, 2014
2 parents 91814d9 + 3f37a87 commit 314b865
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"curly": true,
"eqeqeq": true,
"undef": true,
"node": true
}
6 changes: 3 additions & 3 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
7 changes: 4 additions & 3 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 @@ -181,7 +182,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 @@ -244,7 +245,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 @@ -294,7 +295,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 314b865

Please sign in to comment.