reset variable after build
This commit is contained in:
1 parent
b2acee3b6e
commit
4d8a4a0430
1 file changed
+8
-2
@@ -10,7 +10,7 @@ import { message } from "../misc/hooks";
|
|||||||
import i18n from "../misc/i18n";
|
import i18n from "../misc/i18n";
|
||||||
import Path from "../misc/path";
|
import Path from "../misc/path";
|
||||||
import { zhNodeDef } from "../misc/template";
|
import { zhNodeDef } from "../misc/template";
|
||||||
import { readJson, readTree, readWorkspace, writeJson } from "../misc/util";
|
import { readJson, readTree, readWorkspace, writeJson, writeTree } from "../misc/util";
|
||||||
import { useSetting } from "./setting-context";
|
import { useSetting } from "./setting-context";
|
||||||
|
|
||||||
let buildDir: string | undefined;
|
let buildDir: string | undefined;
|
||||||
@@ -377,6 +377,9 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
message.error(i18n.t("buildFailed"));
|
message.error(i18n.t("buildFailed"));
|
||||||
}
|
}
|
||||||
|
if (workspace.editing) {
|
||||||
|
workspace.refresh(workspace.editing.path);
|
||||||
|
}
|
||||||
console.debug = debug;
|
console.debug = debug;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -404,7 +407,7 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
|||||||
tree = b3util.processBatch(tree, file.path, batch);
|
tree = b3util.processBatch(tree, file.path, batch);
|
||||||
if (tree) {
|
if (tree) {
|
||||||
batch.onWriteFile?.(file.path, tree);
|
batch.onWriteFile?.(file.path, tree);
|
||||||
fs.writeFileSync(file.path, JSON.stringify(tree, null, 2));
|
writeTree(file.path, tree);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
batch.onComplete?.("success");
|
batch.onComplete?.("success");
|
||||||
@@ -412,6 +415,9 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
|
|||||||
hasError = true;
|
hasError = true;
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
if (workspace.editing) {
|
||||||
|
workspace.refresh(workspace.editing.path);
|
||||||
|
}
|
||||||
if (hasError) {
|
if (hasError) {
|
||||||
message.error(i18n.t("batchFailed"));
|
message.error(i18n.t("batchFailed"));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user