Skip to content

Commit

Permalink
feat: restore 이전 로직으로 롤백
Browse files Browse the repository at this point in the history
  • Loading branch information
flydog98 committed Dec 11, 2023
1 parent e3a2e21 commit 3e913af
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/backend/src/containers/containers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,16 @@ export class ContainersService {

let recentMessage = '';

const commands = logs.reduce((acc, log, index, array) => {
const commands: string[] = logs.map((log) => {
if (log.mode === 'command') {
recentMessage = log.message;
if (array[index + 1] && array[index + 1].mode === 'editor') {
return acc;
}
acc.push(log.message);
return log.message;
} else if (log.mode === 'editor') {
acc.push(this.buildEditorCommand(log.message, recentMessage));
return this.buildEditorCommand(log.message, recentMessage);
} else {
throw new Error('Invalid log mode');
}

return acc;
}, []);
});

await this.commandService.executeCommand(
this.buildDockerCommand(containerId, ...commands),
Expand Down

0 comments on commit 3e913af

Please sign in to comment.