fix build error
This commit is contained in:
1 parent
3f06b7b8ec
commit
cde6608313
1 file changed
+5
-4
@@ -273,16 +273,16 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
let hasError = false;
|
let hasError = false;
|
||||||
for (const [path] of workspace.allFiles) {
|
workspace.allFiles.forEach((file) => {
|
||||||
const buildpath = buildDir + "/" + workspace.relative(path);
|
const buildpath = buildDir + "/" + workspace.relative(file.path);
|
||||||
console.log("build:", buildpath);
|
console.log("build:", buildpath);
|
||||||
const treeModel = b3util.createBuildData(path);
|
const treeModel = b3util.createBuildData(file.path);
|
||||||
if (!b3util.checkNodeData(treeModel?.root)) {
|
if (!b3util.checkNodeData(treeModel?.root)) {
|
||||||
hasError = true;
|
hasError = true;
|
||||||
}
|
}
|
||||||
fs.mkdirSync(Path.dirname(buildpath), { recursive: true });
|
fs.mkdirSync(Path.dirname(buildpath), { recursive: true });
|
||||||
fs.writeFileSync(buildpath, JSON.stringify(treeModel, null, 2));
|
fs.writeFileSync(buildpath, JSON.stringify(treeModel, null, 2));
|
||||||
}
|
});
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
message.error(i18n.t("buildFailed"));
|
message.error(i18n.t("buildFailed"));
|
||||||
} else {
|
} else {
|
||||||
@@ -290,6 +290,7 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
message.error(i18n.t("buildFailed"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in new issue
Block a user