!377 fix card type with i18n file copy bug

Merge pull request !377 from 卡哥/OpenHarmony-3.1-Release
This commit is contained in:
openharmony_ci
2022-09-05 09:16:46 +00:00
committed by Gitee
+11 -3
View File
@@ -77,9 +77,8 @@ class GenAbcPlugin {
const keyPath = key.replace(/\.js$/, firstFileEXT)
writeFileSync(newContent, path.resolve(output, keyPath), true);
} else if (output && path.extname(key) === '.json' &&
process.env.DEVICE_LEVEL === 'card') {
writeFileSync(assets[key].source(),
path.resolve(output, key.replace(/\.json$/, '.json')), false);
process.env.DEVICE_LEVEL === 'card' && !checkI18n(key)) {
writeFileSync(assets[key].source(), path.resolve(output, key), false);
}
})
});
@@ -89,6 +88,15 @@ class GenAbcPlugin {
}
}
function checkI18n(key) {
const outI18nPath = path.resolve(output, 'i18n', key);
const projectI18nPath = outI18nPath.replace(output, process.env.projectPath);
if (fs.existsSync(projectI18nPath)) {
return true;
}
return false;
}
function checkWorksFile(assetPath, workerFile) {
if (workerFile === null) {
if (assetPath.search("./workers/") !== 0) {