Skip to content

Commit

Permalink
feat: delete .worldcli cache file if it exists before creating .world…
Browse files Browse the repository at this point in the history
…cli directory
  • Loading branch information
rmrt1n committed Apr 1, 2024
1 parent 9c1d1ca commit 73a91e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ dist/

# Test
/starter-game

# Built binary
world
11 changes: 11 additions & 0 deletions common/globalconfig/globalconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@ func SetupConfigDir() error {
return err
}

fs, err := os.Stat(fullConfigDir)
if !os.IsNotExist(err) {
// remove old .worldcli file
if !fs.IsDir() {
err = os.Remove(fullConfigDir)
if err != nil {
return err
}
}
}

return os.MkdirAll(fullConfigDir, 0755)
}
Binary file removed world
Binary file not shown.

0 comments on commit 73a91e9

Please sign in to comment.