This commit is contained in:
Rizky
2024-11-14 18:44:16 +07:00
parent 0801109562
commit ca8ba09889
2 changed files with 46 additions and 28 deletions
+9 -3
View File
@@ -22,18 +22,24 @@ export const _ = {
| { type: "domain-add"; domain: string }
| { type: "domain-del"; domain: string }
| { type: "deploy-del"; ts: string }
| { type: "deploy"; dlurl: string }
| { type: "deploy"; load_from?: string }
| { type: "deploy-status" }
| { type: "redeploy"; ts: string }
) & {
id_site: string;
}
) {
const { res } = apiContext(this);
const { res, req } = apiContext(this);
const path = dir(`app/web/`);
await dirAsync(path);
if (typeof req.query_parameters["export"] !== "undefined") {
return new Response(
Bun.file(dir(`app/web/deploy/${deploy.config.deploy.ts}.gz`))
);
}
switch (action.type) {
case "check":
const deploys = fs.readdirSync(dir(`/app/web/deploy`));
@@ -164,7 +170,7 @@ export const _ = {
await deploy.saveConfig();
deploy.config.deploy.ts = Date.now() + "";
await deploy.init();
await deploy.init(action.load_from);
const deploys = fs.readdirSync(dir(`/app/web/deploy`));
if (g.mode === "prod") {