Skip to content

Commit 1485f6a

Browse files
authored
Merge pull request #80 from nameczz/dev
v2.1.0
2 parents 80cb915 + 7c6edbc commit 1485f6a

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

.github/workflows/electron.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
uses: samuelmeuli/action-electron-builder@v1
3434
with:
3535
package_root: "./server"
36+
build_script_name: "build-electron"
3637
# GitHub token, automatically provided to the action
3738
# (No need to define this secret in the repo settings)
3839
github_token: ${{ secrets.GH_TOKEN }}

server/electron-prebuild.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
// replace IS_ELECTRON to yes, beacause axios relative url
4+
const envConfig = path.join(__dirname, './build/env-config.js');
5+
fs.readFile(envConfig, 'utf8', function (err, files) {
6+
const result = files.replace(/{{IS_ELECTRON}}/g, 'yes');
7+
fs.writeFile(envConfig, result, 'utf8', function (err) {
8+
if (err) {
9+
console.log(err);
10+
}
11+
});
12+
});

server/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"scripts": {
7878
"prebuild": "tslint -c tslint.json -p tsconfig.json --fix",
7979
"build": "yarn clean && tsc",
80+
"build-electron": "node electron-prebuild && yarn build",
8081
"prestart": "rm -rf dist && yarn build",
8182
"start": "nodemon src/app.ts",
8283
"start:plugin": "yarn build && cross-env PLUGIN_DEV=1 node dist/attu/express/src/app.js",

0 commit comments

Comments
 (0)