mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-20 20:57:01 +00:00
package server with client
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { app, BrowserWindow } from 'electron'
|
||||
import { spawn } from 'child_process'
|
||||
import * as path from 'path'
|
||||
// This allows TypeScript to pick up the magic constants that's auto-generated by Forge's Webpack
|
||||
// plugin that tells the Electron app where to look for the Webpack-bundled app code (depending on
|
||||
// whether you're running in development or production).
|
||||
@@ -24,6 +26,17 @@ const createWindow = (): void => {
|
||||
transparent: true,
|
||||
})
|
||||
|
||||
// Start the executable
|
||||
let pyExecutable = path.join(__dirname, '../renderer/resources/server')
|
||||
console.log(`Starting ${pyExecutable}`)
|
||||
let pyProcess = spawn(pyExecutable)
|
||||
pyProcess.stdout.on('data', data => {
|
||||
console.log(`server: ${data}`)
|
||||
})
|
||||
pyProcess.stderr.on('data', data => {
|
||||
console.error(`server: ${data}`)
|
||||
})
|
||||
|
||||
// and load the index.html of the app.
|
||||
mainWindow.loadURL(MAIN_WINDOW_WEBPACK_ENTRY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user