Browse Source

Remove unused root files

master
Matthew Faltys 5 years ago
parent
commit
e7cc62f05a
  1. 18
      nethack-launcher/create_initial_files.go
  2. 2
      nethack-launcher/create_user_files.go

18
nethack-launcher/create_initial_files.go

@ -11,18 +11,12 @@ func createInitialFiles() {
if _, err := os.Stat(config.NethackLauncher.HackDir); os.IsNotExist(err) {
os.Mkdir(config.NethackLauncher.HackDir, os.ModeDir)
}
if _, err := os.Stat(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir)); os.IsNotExist(err) {
os.Mkdir(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir), os.ModeDir)
}
if _, err := os.Stat(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir)); os.IsNotExist(err) {
os.Mkdir(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir), os.ModeDir)
}
// create necessary files if they dont exist
os.OpenFile(fmt.Sprintf("%s/logfile", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666)
os.OpenFile(fmt.Sprintf("%s/perm", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666)
os.OpenFile(fmt.Sprintf("%s/record", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666)
os.OpenFile(fmt.Sprintf("%s/xlogfile", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666)
//if _, err := os.Stat(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir)); os.IsNotExist(err) {
// os.Mkdir(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir), os.ModeDir)
//}
//if _, err := os.Stat(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir)); os.IsNotExist(err) {
// os.Mkdir(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir), os.ModeDir)
//}
// move in nhdat file if it does not exist
if _, err := os.Stat(fmt.Sprintf("%s/nhdat", config.NethackLauncher.HackDir)); os.IsNotExist(err) {

2
nethack-launcher/create_user_files.go

@ -24,5 +24,5 @@ func createUserFiles(username string) {
os.OpenFile(fmt.Sprintf("%s/xlogfile", userpath), os.O_RDONLY|os.O_CREATE, 0666)
// move in nhdat file if it does not exist
exec.Command("cp", config.NethackLauncher.NhdatLocation, userpath).Run()
exec.Command("cp", fmt.Sprintf("%s/nhdat", config.NethackLauncher.HackDir), userpath).Run()
}

Loading…
Cancel
Save