This commit is contained in:
Rizky
2024-05-14 12:50:25 +07:00
parent 3ef8db58b9
commit be6a9e36af
3 changed files with 19 additions and 2 deletions
+10
View File
@@ -1,5 +1,6 @@
import {
dirAsync,
exists,
existsAsync,
read,
removeAsync,
@@ -37,6 +38,15 @@ export const deploy = {
);
if (g.deploy.gz) {
if (exists(dir("public"))) {
await removeAsync(dir("public"));
if (g.deploy.gz.public) {
await dirAsync(dir("public"));
for (const [k, v] of Object.entries(g.deploy.gz.public)) {
await writeAsync(dir(`public/${k}`), v);
}
}
}
for (const page of g.deploy.gz.layouts) {
if (page.is_default_layout) {
g.deploy.layout = page.content_tree;
+2 -1
View File
@@ -88,8 +88,9 @@ export const g = global as unknown as {
gz: null | {
layouts: SinglePage[];
pages: SinglePage[];
site: {};
site: any;
comps: { id: string; content_tree: true }[];
public: Record<string, any>;
code: {
server: Record<string, string>;
site: Record<string, string>;