Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
GLDuval committed May 9, 2023
1 parent 06aeb38 commit 29eb398
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
"output": "dist"
},
"artifactName": "capra_web_ui_setup.${ext}",
"extends": "electron-snowpack/config/electron-builder.js"
"extends": "electron-snowpack/config/electron-builder.js",
"extraFiles": [
"script/**"
]
},
"dependencies": {
"@cycjimmy/jsmpeg-player": "^6.0.5",
Expand Down
1 change: 0 additions & 1 deletion snowpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module.exports = {
extends: 'electron-snowpack/config/snowpack.js',
mount: {
'src/shared': '/shared',
script: '/script',
},
alias: {
'@/': './src/',
Expand Down
11 changes: 5 additions & 6 deletions src/main/rtspServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { log } from '@/main/logger';
import { app, ipcMain } from 'electron';
import { ExecaChildProcess, execa } from 'execa';
import path from 'path';
import { isDev } from '@/main/isDev';
import { RTSP_START, RTSP_STOP } from './preload';
import process from 'process';

interface RtspProcess {
process: ExecaChildProcess;
Expand All @@ -17,16 +17,15 @@ const ports = Array.from({ length: 61 }, (_, i) => i + 9000);

ipcMain.handle(RTSP_START, (_, url: string) => {
const nextPort = ports.shift() ?? 9000;
const process = execa('node', [
isDev
const rtspProcess = execa('node', [
!app.isPackaged
? './script/rtspServer.js'
: path.join(app.getAppPath(), '../renderer/script/rtspServer.js'),
: path.resolve(`${process.resourcesPath}/../script/rtspServer.js`),
url,
nextPort.toString(),
]);

rtspServers.set(nextPort, {
process,
process: rtspProcess,
wsPort: nextPort,
});

Expand Down

0 comments on commit 29eb398

Please sign in to comment.