Fix issue where if termux installer failed with an exception after prefix directory was already created, then try again would load a broken environment.

This commit is contained in:
agnostic-apollo
2021-06-10 08:06:43 +05:00
parent e119d34bca
commit 19c690d02b

View File

@@ -173,6 +173,7 @@ final class TermuxInstaller {
activity.finish(); activity.finish();
}).setPositiveButton(R.string.bootstrap_error_try_again, (dialog, which) -> { }).setPositiveButton(R.string.bootstrap_error_try_again, (dialog, which) -> {
dialog.dismiss(); dialog.dismiss();
FileUtils.deleteFile(activity, "prefix directory", PREFIX_FILE_PATH, true);
TermuxInstaller.setupBootstrapIfNeeded(activity, whenDone); TermuxInstaller.setupBootstrapIfNeeded(activity, whenDone);
}).show(); }).show();
} catch (WindowManager.BadTokenException e1) { } catch (WindowManager.BadTokenException e1) {