fix
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user