mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-22 05:10:34 +02:00
25 lines
391 B
Go
25 lines
391 B
Go
package main
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"log"
|
|
)
|
|
|
|
// Lists save files in factorio/saves
|
|
func listSaves() []string {
|
|
saveDir := config.FactorioDir + "/saves"
|
|
result := []string{}
|
|
|
|
files, err := ioutil.ReadDir(saveDir)
|
|
if err != nil {
|
|
log.Printf("Error listing save directory: %s", err)
|
|
return result
|
|
}
|
|
|
|
for _, f := range files {
|
|
result = append(result, f.Name())
|
|
}
|
|
|
|
return result
|
|
}
|