Skip to content

Commit

Permalink
allow case with no comment stating where to put the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Vagahbond committed Jul 28, 2021
1 parent 6ef831b commit eb60478
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/exec-server/godbox.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ export class GodBoxRepository {
): Promise<GodboxPhaseOutputDTO> {
const language = await this.languagesService.findByName(bootstrap.language);

const completeCode = bootstrap.tests.replace('// USER_CODE', code);
const completeCode = bootstrap.tests.includes('// USER_CODE')
? bootstrap.tests.replace('// USER_CODE', code)
: `${bootstrap.tests}\n${code}`;

const payload = {
phases: language.phases,
Expand Down

0 comments on commit eb60478

Please sign in to comment.