Skip to content

Commit

Permalink
feat: decode out and return obj
Browse files Browse the repository at this point in the history
  • Loading branch information
fabryscript committed Feb 9, 2024
1 parent fed315f commit 54d07f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,14 @@ ipcMain.handle('start-project', async (e, file: ProjectFile[]) => {
const commandShell = spawn('sh', ['-c', command], {
detached: true,
});
const decoder = new TextDecoder('utf-8');

if (commandShell.stdout) {
commandShell.stdout.on('data', (data) => {
mainWindow?.webContents.send('shell-result', data);
mainWindow?.webContents.send('shell-result', {
name,
out: decoder.decode(data),
});
});
}
runningShells.push({ name, pid: commandShell.pid! });
Expand Down

0 comments on commit 54d07f5

Please sign in to comment.