From 36a27cc5b454a325b0ae4b1281dd6d7f3c572a77 Mon Sep 17 00:00:00 2001 From: kreuzerk Date: Thu, 13 Dec 2018 16:27:18 +0100 Subject: [PATCH 1/2] feat(pathSeparator): accept pathSeparator as option --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7ca0958..5f1231e 100644 --- a/index.js +++ b/index.js @@ -26,12 +26,13 @@ function Plugin(options) { this.crxName = this.options.name + ".crx"; this.crxFile = join(this.outputPath, this.crxName); this.updateFile = join(this.outputPath, this.options.updateFilename); - this.updateUrl = this.options.updateUrl + "/" + this.options.updateFilename; + const pathSeparator = this.options.pathSeparator || '/'; + this.updateUrl = this.options.updateUrl + pathSeparator + this.options.updateFilename; // initiate crx this.crx = new ChromeExtension({ privateKey: fs.readFileSync(this.keyFile), - codebase: this.options.updateUrl + '/' + this.crxName + codebase: this.options.updateUrl + pathSeparator + this.crxName }); } From 8434d38247f57f0424ade51f3e2ecd333d9baf59 Mon Sep 17 00:00:00 2001 From: kreuzerk Date: Thu, 13 Dec 2018 16:40:33 +0100 Subject: [PATCH 2/2] docs(pathSeparator): document available options --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f282b66..5a7fa57 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,19 @@ module.exports = { } ``` +### Options +You can pass the following options to the new Crx call: + +| Option | Description |Default | +| ------------- |-------------| -----| +| updateUrl | location of the updates.xml | http://localhost:8000/ | +| updateFilename | name of the updates.xml | updates.xml | +| keyFile | path to the pem file | - | +| outputPath | output path of the .crx file | - | +| contentPath | path of the source file | - | +| name | name of the extension / crx file | - | +| pathSeparator | pathSeparator. Specifies which pathSeparator should be used when composing the updates.xml url file. We can not use the path you are building your extension because in the end the path where you host your extension is important. Use (\\) if you deliver your extension over windows | / | + ## License MIT (http://www.opensource.org/licenses/mit-license.php)