fix xts abc size is empty

Signed-off-by: zhangrengao <zhangrengao1@huawei.com>
Change-Id: Ibf2e02471b75c494046b48211673b96389091fdf
This commit is contained in:
zhangrengao
2022-08-23 19:44:25 +08:00
parent 78950f30a5
commit bea3fa086f
+11 -4
View File
@@ -797,8 +797,10 @@ function filterIntermediateJsBundleByHashJson(buildPath: string, inputPaths: Fil
if (jsonObject[cacheOutputPath] === hashInputContentData && jsonObject[cacheAbcFilePath] === hashAbcContentData) {
updateJsonObject[cacheOutputPath] = hashInputContentData;
updateJsonObject[cacheAbcFilePath] = hashAbcContentData;
mkdirsSync(path.dirname(abcPath));
fs.copyFileSync(cacheAbcFilePath, abcPath);
if (!fs.existsSync(abcPath)) {
mkdirsSync(path.dirname(abcPath));
fs.copyFileSync(cacheAbcFilePath, abcPath);
}
} else {
fileterIntermediateJsBundle.push(inputPaths[i]);
}
@@ -835,8 +837,13 @@ function writeHashJson(): void {
process.exitCode = FAIL;
break;
}
mkdirsSync(path.dirname(abcFile));
fs.copyFileSync(cacheAbcFilePath, abcFile);
if (!fs.existsSync(abcFile)) {
mkdirsSync(path.dirname(abcFile));
fs.copyFileSync(cacheAbcFilePath, abcFile);
}
if (fs.existsSync(intermediateJsBundle[i].path)) {
fs.unlinkSync(intermediateJsBundle[i].path);
}
}
const hashFilePath: string = genHashJsonPath(buildPathInfo);
if (hashFilePath.length === 0) {