This commit is contained in:
@@ -39,7 +39,7 @@ func init() {
|
||||
}
|
||||
|
||||
func One(gameID string) (Remote, error) {
|
||||
content, err := os.ReadFile(filepath.Join(datastorepath, gameID, "remote.json"))
|
||||
content, err := os.ReadFile(filepath.Clean(filepath.Join(datastorepath, gameID, "remote.json")))
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return Remote{}, ErrNoRemote
|
||||
@@ -62,7 +62,7 @@ func Set(gameID, url string) error {
|
||||
URL: url,
|
||||
}
|
||||
|
||||
f, err := os.OpenFile(filepath.Join(datastorepath, gameID, "remote.json"), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
|
||||
f, err := os.OpenFile(filepath.Join(filepath.Join(datastorepath, gameID, "remote.json")), os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user