mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Don't delete existing mods when copying mods from the external diretory on Android app startup
This commit is contained in:
parent
27c8243a78
commit
010497e095
@ -53,10 +53,6 @@ class AndroidLauncher : AndroidApplication() {
|
||||
// Mod directory in the shared app data (where the user can see and modify)
|
||||
val externalModsDir = File("${getExternalFilesDir(null)?.path}/mods")
|
||||
|
||||
// Empty out the mods directory so it can be replaced by the external one
|
||||
// Done to ensure it only contains mods in the external dir (so users can delete some)
|
||||
if (internalModsDir.exists()) internalModsDir.deleteRecursively()
|
||||
|
||||
// Copy external mod directory (with data user put in it) to internal (where it can be read)
|
||||
if (!externalModsDir.exists()) externalModsDir.mkdirs() // this can fail sometimes, which is why we check if it exists again in the next line
|
||||
if (externalModsDir.exists()) externalModsDir.copyRecursively(internalModsDir)
|
||||
|
Loading…
Reference in New Issue
Block a user