Skip to content

Commit

Permalink
Make the debugging bookmarklet loader.js point to staging zotero
Browse files Browse the repository at this point in the history
  • Loading branch information
adomasven committed Oct 11, 2018
1 parent 8e3dda0 commit a14b3a2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/gulpfile_bookmarklet.js
Expand Up @@ -143,10 +143,15 @@ function processFile(argv) { return through.obj(async function(file, enc, cb) {
);
break;
case 'loader.js':
let config = await fs.readFile(join(__dirname, '../src/bookmarklet/zotero_config.js'), 'utf-8');
let url = /BOOKMARKLET_URL: ?['"]([^'"]*)['"]/.exec(config)[1];
file.contents = Buffer.from(file.contents.toString()
.replace('https://www.zotero.org/bookmarklet/', url));
if (!argv.p) {
file.contents = Buffer.from(file.contents.toString()
.replace('www.zotero.org', 'staging.zotero.net'));
} else {
let config = await fs.readFile(join(__dirname, '../src/bookmarklet/zotero_config.js'), 'utf-8');
let url = /BOOKMARKLET_URL: ?['"]([^'"]*)['"]/.exec(config)[1];
file.contents = Buffer.from(file.contents.toString()
.replace('https://www.zotero.org/bookmarklet/', url));
}
}


Expand Down

0 comments on commit a14b3a2

Please sign in to comment.