From 3adad053b191f1993933b5276de2539c71320248 Mon Sep 17 00:00:00 2001 From: Northword Date: Thu, 13 Jul 2023 10:17:24 +0800 Subject: [PATCH 1/2] Fix glob pattern in ReplaceInFileConfig.files --- package.json | 4 ++-- scripts/build.mjs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 2415eac..1d7351d 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,8 @@ "eslint-config-prettier": "^8.8.0", "prettier": "3.0.0", "release-it": "^16.1.0", - "replace-in-file": "^6.3.5", + "replace-in-file": "^7.0.1", "typescript": "^5.0.4", "zotero-types": "^1.0.14" } -} \ No newline at end of file +} diff --git a/scripts/build.mjs b/scripts/build.mjs index 19b96a5..3cfa31b 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -130,11 +130,11 @@ function replaceString() { const optionsAddon = { files: [ - path.join(buildDir, "**/*.xhtml"), - path.join(buildDir, "**/*.json"), - path.join(buildDir, "addon/prefs.js"), - path.join(buildDir, "addon/manifest.json"), - path.join(buildDir, "addon/bootstrap.js"), + `${buildDir}/addon/**/*.xhtml`, + `${buildDir}/addon/**/*.json`, + `${buildDir}/addon/prefs.js`, + `${buildDir}/addon/manifest.json`, + `${buildDir}/addon/bootstrap.js`, "update.json", ], from: replaceFrom, @@ -148,7 +148,7 @@ function replaceString() { const localeMessageMiss = new Set(); const replaceResultFlt = replaceInFileSync({ - files: [path.join(buildDir, "addon/**/*.ftl")], + files: [`${buildDir}/addon/locale/**/*.ftl`], processor: (fltContent) => { const lines = fltContent.split("\n"); const prefixedLines = lines.map((line) => { @@ -168,7 +168,7 @@ function replaceString() { }); const replaceResultXhtml = replaceInFileSync({ - files: [path.join(buildDir, "addon/**/*.xhtml")], + files: [`${buildDir}/addon/**/*.xhtml`], processor: (input) => { const matchs = [...input.matchAll(/(data-l10n-id)="(\S*)"/g)]; matchs.map((match) => { From 0ff56d5303529da357ec868c12929d94d6a66d12 Mon Sep 17 00:00:00 2001 From: windingwind <33902321+windingwind@users.noreply.github.com> Date: Thu, 13 Jul 2023 12:03:14 +0800 Subject: [PATCH 2/2] fix: start.mjs profile path --- scripts/start.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.mjs b/scripts/start.mjs index 268d160..09b6f85 100644 --- a/scripts/start.mjs +++ b/scripts/start.mjs @@ -56,7 +56,7 @@ if (existsSync(profilePath)) { throw new Error("The given Zotero profile does not exist."); } -const startZotero = `"${zoteroBinPath}" --debugger --purgecaches -profile ${profilePath}`; +const startZotero = `"${zoteroBinPath}" --debugger --purgecaches -profile "${profilePath}"`; execSync(startZotero); exit(0);