Skip to content

Instantly share code, notes, and snippets.

@exerro
Created June 11, 2016 23:33
Show Gist options
  • Save exerro/fe54b78051e5575cbc89eccdab718697 to your computer and use it in GitHub Desktop.
Save exerro/fe54b78051e5575cbc89eccdab718697 to your computer and use it in GitHub Desktop.
local function copy( a, b )
if love.filesystem.isDirectory( a ) then
for i, file in ipairs( love.filesystem.getDirectoryItems( a ) ) do
copy( a .. "/" .. file, b .. "/" .. file )
end
else
love.filesystem.write( b, love.filesystem.read( a ) )
end
end
if not love.filesystem.isDirectory "plugins" then
copy( "data/plugins", "plugins" )
end
if not love.filesystem.isDirectory "user" then
copy( "data/user", "user" )
end
if not love.filesystem.isDirectory "resources" then
copy( "data/resources", "resources" )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment