Skip to content

Commit

Permalink
refac
Browse files Browse the repository at this point in the history
  • Loading branch information
tjbck committed Jan 14, 2025
1 parent ecbaf0b commit bd753e8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,21 @@ export async function startServer(installationPath?: string, port?: number): Pro
return;
}

try {
const bundledPythonPath = getBundledPythonPath();

// Execute the Python binary to print the version
const pythonVersion = execFileSync(bundledPythonPath, ['--version'], {
encoding: 'utf-8'
});
console.log('Installed Python Version:', pythonVersion.trim());
logEmitter.emit('log', `Installed Python Version: ${pythonVersion.trim()}`); // Emit log

} catch (error) {
log.error('Failed to execute Python binary', error);

}

let startCommand =
process.platform === 'win32'
? `"${installationPath}\\Scripts\\activate.bat" && open-webui serve`
Expand All @@ -426,7 +441,6 @@ export async function startServer(installationPath?: string, port?: number): Pro
shell: true,
detached: process.platform !== 'win32', // Detach the child process on Unix-like platforms
stdio: ['ignore', 'pipe', 'pipe'], // Let us capture logs via stdout/stderr
windowsHide: true
});

let serverCrashed = false;
Expand Down

0 comments on commit bd753e8

Please sign in to comment.