mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 09:19:03 -06:00
Small cleanup to file info checking
This commit is contained in:
parent
6c201596b0
commit
56fb5aebea
@ -1,8 +1,10 @@
|
||||
local binser = require 'libs.binser'
|
||||
|
||||
function loadSave()
|
||||
local info = love.filesystem.getInfo(love.filesystem.getSaveDirectory())
|
||||
if not info or info.type ~= "directory" then
|
||||
local info = love.filesystem.getInfo(
|
||||
love.filesystem.getSaveDirectory(), "directory"
|
||||
)
|
||||
if not info then
|
||||
love.filesystem.remove(love.filesystem.getSaveDirectory())
|
||||
love.filesystem.createDirectory(love.filesystem.getSaveDirectory())
|
||||
end
|
||||
|
4
main.lua
4
main.lua
@ -99,8 +99,8 @@ function love.keypressed(key, scancode)
|
||||
-- f12 is reserved for saving screenshots
|
||||
elseif scancode == "f12" then
|
||||
local ss_name = os.date("ss/%Y-%m-%d_%H-%M-%S.png")
|
||||
local info = love.filesystem.getInfo("ss")
|
||||
if not info or info.type ~= "directory" then
|
||||
local info = love.filesystem.getInfo("ss", "directory")
|
||||
if not info then
|
||||
love.filesystem.remove("ss")
|
||||
love.filesystem.createDirectory("ss")
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user