Skip to content

A local-first personal finance app

refactor: move script to update client build into electron package

Tom Frenchda62f9b5d945
diff --git a/bin/package b/bin/package
index b34a830b50..687ad4995d 100755
--- a/bin/package
+++ b/bin/package
@@ -89,15 +89,10 @@ yarn workspace loot-core build:node
yarn workspace @actual-app/web build
-rm -fr packages/desktop-electron/client-build
-cp -r packages/desktop-client/build packages/desktop-electron/client-build
-# Remove the embedded backend for the browser version. Will improve
-# this process
-rm -fr packages/desktop-electron/client-build/data
-rm -fr packages/desktop-electron/client-build/*kcab.*
-rm -fr packages/desktop-electron/client-build/*.wasm
-rm -fr packages/desktop-electron/client-build/*.map
-
+(
+ cd packages/desktop-electron;
+ yarn update-client
+)
if [ -n "$RELEASE" ]; then
SENTRY_CLI="./packages/desktop-electron/node_modules/.bin/sentry-cli"
diff --git a/packages/desktop-electron/bin/update-client b/packages/desktop-electron/bin/update-client
new file mode 100755
index 0000000000..39dc036ad9
--- /dev/null
+++ b/packages/desktop-electron/bin/update-client
@@ -0,0 +1,13 @@
+#!/bin/bash -e
+
+ROOT=`dirname $0`
+
+rm -rf ${ROOT}/../client-build
+cp -r ${ROOT}/../../desktop-client/build ${ROOT}/../client-build
+
+# Remove the embedded backend for the browser version. Will improve
+# this process
+rm -rf ${ROOT}/../client-build/data
+rm -rf ${ROOT}/../client-build/*kcab.*
+rm -rf ${ROOT}/../client-build/*.wasm
+rm -rf ${ROOT}/../client-build/*.map
diff --git a/packages/desktop-electron/package.json b/packages/desktop-electron/package.json
index 29df4a2788..d1eea9121f 100644
--- a/packages/desktop-electron/package.json
+++ b/packages/desktop-electron/package.json
@@ -6,6 +6,7 @@
"version": "4.0.2",
"scripts": {
"clean": "rm -rf dist",
+ "update-client": "bin/update-client",
"build": "electron-builder",
"watch": "cross-env ACTUAL_DOCUMENT_DIR=\"../../data\" ACTUAL_DATA_DIR=\"../../data\" electron ."
},