mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2024-12-27 02:43:45 +02:00
backend check for save files exist
This commit is contained in:
parent
61cd0cbe03
commit
8357027552
@ -3,6 +3,7 @@ package factorio
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
@ -230,6 +231,15 @@ func (server *Server) Run() error {
|
||||
ioutil.WriteFile(config.SettingsFile, data, 0644)
|
||||
}
|
||||
|
||||
saves, err := ListSaves(config.FactorioSavesDir)
|
||||
if err != nil {
|
||||
log.Println("Failed to get saves list: ", err)
|
||||
}
|
||||
|
||||
if len(saves) == 0 {
|
||||
return errors.New("No savefile exists on the server")
|
||||
}
|
||||
|
||||
args := []string{}
|
||||
|
||||
//The factorio server refenences its executable-path, since we execute the ld.so file and pass the factorio binary as a parameter
|
||||
|
Loading…
Reference in New Issue
Block a user