Skip to content

Commit 8e0c01f

Browse files
committed
fix(pkgbuild): make regex more generic
1 parent d3a4259 commit 8e0c01f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

PKGBUILD

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ build() {
6161

6262
cd electron-app
6363
npx asar extract app.asar app.asar.contents
64-
sed -i 's|return ..app.isPackaged?.*resolve(__dirname,"..","..","resources")|return "/usr/lib/'"${pkgname}"'/resources"|' app.asar.contents/.vite/build/index*.js
65-
# note that the below is replacing i18n with the standard resources directory as that's where the i18n json files wind up
66-
sed -i 's|return ..app.isPackaged?.*resolve(__dirname,"..","..","resources","i18n")|return "/usr/lib/'"${pkgname}"'/resources"|' app.asar.contents/.vite/build/index*.js
64+
# Fix resource paths - handle different variable names for app object
65+
sed -i 's|return[[:space:]]\+[a-zA-Z_][a-zA-Z0-9_]*\.app\.isPackaged[[:space:]]*?[^:]*:[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*\.resolve([^,]*,[[:space:]]*"\.\.","\.\.","resources")|return "/usr/lib/'"${pkgname}"'/resources"|g' app.asar.contents/.vite/build/index*.js
66+
# Fix i18n resource paths specifically
67+
sed -i 's|return[[:space:]]\+[a-zA-Z_][a-zA-Z0-9_]*\.app\.isPackaged[[:space:]]*?[^:]*:[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]*\.resolve([^,]*,[[:space:]]*"\.\.","\.\.","resources","i18n")|return "/usr/lib/'"${pkgname}"'/resources"|g' app.asar.contents/.vite/build/index*.js
6768
# fix negation operator to show menubar
6869
sed -i -E 's/if\(!([a-zA-Z]+)[[:space:]]*&&[[:space:]]*([a-zA-Z]+)\)/if(\1 \&\& \2)/g' app.asar.contents/.vite/renderer/main_window/assets/MainWindowPage-*.js
6970

0 commit comments

Comments
 (0)