This is an automated email from the ASF dual-hosted git repository.
raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git
The following commit(s) were added to refs/heads/master by this push:
new 1b78746 fix(prepare): delete splash screens if none are used (#1227)
1b78746 is described below
commit 1b7874607e8c2c6ae092149379be80a590849674
Author: Raphael von der GrĂ¼n <[email protected]>
AuthorDate: Thu May 6 09:30:19 2021 +0200
fix(prepare): delete splash screens if none are used (#1227)
Currently, we copy default splash screens to the platform folder during
platform creation, but then we do not delete them when the user uses no splash
screens at all. This causes #1226 and what is described in #689.
The new implementation does not return early when updating splashes and
none are defined. Instead, we let the cleanup map we create initially take care
of deleting all unused splash screens. This also deletes the default splashes
during the first prepare after platform creation.
Fixes #1226
---
bin/templates/cordova/lib/prepare.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/templates/cordova/lib/prepare.js
b/bin/templates/cordova/lib/prepare.js
index 27e952e..b01ce9a 100644
--- a/bin/templates/cordova/lib/prepare.js
+++ b/bin/templates/cordova/lib/prepare.js
@@ -328,10 +328,13 @@ function makeSplashCleanupMap (projectRoot, resourcesDir)
{
function updateSplashes (cordovaProject, platformResourcesDir) {
var resources = cordovaProject.projectConfig.getSplashScreens('android');
- // if there are "splash" elements in config.xml
+ // if there are no "splash" elements in config.xml
if (resources.length === 0) {
events.emit('verbose', 'This app does not have splash screens
defined');
- return;
+ // We must not return here!
+ // If the user defines no splash screens, the cleanup map will cause
any
+ // existing splash screen images (e.g. the defaults that we copy into a
+ // new app) to be removed from the app folder, which is what we want.
}
// Build an initial resource map that deletes all existing splash screens
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]