diff --git a/js-build/note-editor.js b/js-build/note-editor.js index 1435730342..581f85cee8 100644 --- a/js-build/note-editor.js +++ b/js-build/note-editor.js @@ -30,9 +30,13 @@ async function getZoteroNoteEditor(signatures) { `cd ${tmpDir}` + ` && (test -f ${filename} || curl -f ${url} -o ${filename})` + ` && unzip ${filename} zotero/* -d ${targetDir}` - + ` && mv ${path.join(targetDir, 'zotero', '*')} ${targetDir}` ); + // Move the contents of zotero/ up a level (not in the shell, whose glob + // handling breaks on Windows paths) + for (let entry of await fs.readdir(path.join(targetDir, 'zotero'))) { + await fs.move(path.join(targetDir, 'zotero', entry), path.join(targetDir, entry)); + } await fs.remove(path.join(targetDir, 'zotero')); } catch (e) { diff --git a/js-build/reader.js b/js-build/reader.js index 12b5df6a92..6f5f631e33 100644 --- a/js-build/reader.js +++ b/js-build/reader.js @@ -30,9 +30,13 @@ async function getReader(signatures) { `cd ${tmpDir}` + ` && (test -f ${filename} || curl -f ${url} -o ${filename})` + ` && unzip ${filename} zotero/* -d ${targetDir}` - + ` && mv ${path.join(targetDir, 'zotero', '*')} ${targetDir}` ); + // Move the contents of zotero/ up a level (not in the shell, whose glob + // handling breaks on Windows paths) + for (let entry of await fs.readdir(path.join(targetDir, 'zotero'))) { + await fs.move(path.join(targetDir, 'zotero', entry), path.join(targetDir, entry)); + } await fs.remove(path.join(targetDir, 'zotero')); } catch (e) {