fix doric-cli error

This commit is contained in:
pengfei.zhou 2021-03-03 14:39:32 +08:00 committed by osborn
parent 0e430cc342
commit 7e4b7258e7

View File

@ -61,9 +61,13 @@ async function doMerge(jsFile: string) {
export async function mergeMap(mapFile: string) {
const mapContent = await fs.promises.readFile(mapFile, "utf-8");
if (JSON.parse(mapContent).merged) {
console.log("Already merged");
return;
try {
if (JSON.parse(mapContent).merged) {
console.log("Already merged");
return;
}
} catch (err) {
console.error(err);
}
const lockFile = `${mapFile}.lock`;
if (fs.existsSync(lockFile)) {