Fix Zotero.Fulltext tests

This commit is contained in:
Martynas Bagdonas 2018-01-18 16:48:44 +02:00 committed by Dan Stillman
parent 5815088586
commit 723b4d32e5
4 changed files with 35 additions and 27 deletions

View file

@ -294,32 +294,7 @@ if(run) {
Zotero.spawn(function* () {
yield Zotero.Schema.schemaUpdatePromise;
// Init paths for PDF tools and data
let pdfConvertedFileName = 'pdftotext';
let pdfInfoFileName = 'pdfinfo';
if (Zotero.isWin) {
pdfConvertedFileName += '-win.exe';
pdfInfoFileName += '-win.exe';
}
else if (Zotero.isMac) {
pdfConvertedFileName += '-mac';
pdfInfoFileName += '-mac';
}
else {
let cpu = Zotero.platform.split(' ')[1];
pdfConvertedFileName += '-linux-' + cpu;
pdfInfoFileName += '-linux-' + cpu;
}
let pdfToolsPath = OS.Path.join(Zotero.Profile.dir, 'pdftools');
let pdfConverterPath = OS.Path.join(pdfToolsPath, pdfConvertedFileName);
let pdfInfoPath = OS.Path.join(pdfToolsPath, pdfInfoFileName);
let pdfDataPath = OS.Path.join(pdfToolsPath, 'poppler-data');
Zotero.FullText.setPDFConverterPath(pdfConverterPath);
Zotero.FullText.setPDFInfoPath(pdfInfoPath);
Zotero.FullText.setPDFDataPath(pdfDataPath);
initPDFToolsPath();
return mocha.run();
})