Skip to content

Commit e968cac

Browse files
authoredJun 30, 2022
fix: support installing platfrom from local git checkout (#1453)
1 parent 861fec2 commit e968cac

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed
 

‎lib/prepare.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,17 @@ function updateProjectSplashScreenImage (locations, themeKey, cdvConfigPrefKey,
553553
let possiblePreviousDestFilePath = path.join(destPngDir, destFileName + '.png');
554554

555555
// Default Drawable Source File
556-
const defaultSrcFilePath = themeKey !== 'windowSplashScreenBrandingImage'
557-
? require.resolve('cordova-android/templates/project/res/drawable/' + destFileNameExt)
558-
: null;
556+
let defaultSrcFilePath = null;
557+
558+
if (themeKey !== 'windowSplashScreenBrandingImage') {
559+
try {
560+
// coming from user project
561+
defaultSrcFilePath = require.resolve('cordova-android/templates/project/res/drawable/' + destFileNameExt);
562+
} catch (e) {
563+
// coming from repo test & coho
564+
defaultSrcFilePath = require.resolve('../templates/project/res/drawable/' + destFileNameExt);
565+
}
566+
}
559567

560568
if (!cdvConfigPrefValue || !fs.existsSync(cdvConfigPrefValue)) {
561569
let emitType = 'verbose';

0 commit comments

Comments
 (0)