|
|
|
@ -11,10 +11,12 @@ func createUserFiles(username string) {
|
|
|
|
|
userPath := fmt.Sprintf("%s/user/%s/ttyrec/", config.NethackLauncher.HackDir, username) |
|
|
|
|
exec.Command("mkdir", "-p", userPath).Run() |
|
|
|
|
|
|
|
|
|
// copy in rc file
|
|
|
|
|
// copy in rc file if it does not exist
|
|
|
|
|
hackRCLoc := fmt.Sprintf("%s/.nethackrc", config.NethackLauncher.HackDir) |
|
|
|
|
hackRCDest := fmt.Sprintf("%s/user/%s/.nethackrc", config.NethackLauncher.HackDir, username) |
|
|
|
|
exec.Command("cp", hackRCLoc, hackRCDest).Run() |
|
|
|
|
if _, err := os.Stat(hackRCLoc); os.IsNotExist(err) { |
|
|
|
|
hackRCDest := fmt.Sprintf("%s/user/%s/.nethackrc", config.NethackLauncher.HackDir, username) |
|
|
|
|
exec.Command("cp", hackRCLoc, hackRCDest).Run() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// create necessary directories if they dont exist
|
|
|
|
|
userpath := fmt.Sprintf("%s/user/%s", config.NethackLauncher.HackDir, username) |
|
|
|
|