Skip to content

Commit

Permalink
Fix Default code (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-vimal authored Mar 6, 2020
1 parent fe5d4a7 commit c269b77
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public class VersionControlService {
@Value("${storage.playerLockedcode.dir}")
private String lockedCodeStoragePath;

@Value("${storage.playercode.default.user.id}")
private String defaultCodeUserId;

@Value("${storage.playercode.filename}")
private String codeFileName;

Expand Down Expand Up @@ -210,7 +213,9 @@ public void createCodeRepository(Integer userId) {

// Create code file, add and commit
FileHandler.createFile(getCodeFileUri(userId));
String defaultCode = FileHandler.getFileContents(getCodeFileUri(Integer.valueOf(defaultCodeUserId)));
FileHandler.createFile(getLockedCodeFileUri(userId));
FileHandler.writeFileContents(getCodeFileUri(userId), defaultCode);

gitAdd(userId);
commit(userId, "Initial Commit");
Expand Down

0 comments on commit c269b77

Please sign in to comment.