Skip to content

Commit

Permalink
create mail dir on start/migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Mar 26, 2020
1 parent 68a5d61 commit 1d167c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion migrate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
-- migrate from mail.db to player-file-based mailbox

mail.migrate = function()
-- create directory, just in case
minetest.mkdir(mail.maildir)

local file = io.open(minetest.get_worldpath().."/mail.db", "r")
if file then
print("[mail] migrating to new per-player storage")
minetest.mkdir(mail.maildir)

local data = file:read("*a")
local oldmails = minetest.deserialize(data)
Expand Down

0 comments on commit 1d167c2

Please sign in to comment.