This commit is contained in:
Rizky 2024-01-25 16:20:57 +07:00
parent 994ba5e608
commit 0b799c24b0
2 changed files with 41 additions and 39 deletions

BIN
dockerzip

Binary file not shown.

View File

@ -1,13 +1,11 @@
import { $ } from "execa";
import fs from "fs";
import {
copyAsync,
dirAsync,
existsAsync,
removeAsync
} from "fs-jetpack";
import { copyAsync, dirAsync, existsAsync, removeAsync } from "fs-jetpack";
import path from "path";
const g = global as any;
if (!g.dockerPrepared) {
g.dockerPrepared = true;
const dir = {
path(...allpath: any[]) {
return path.join(process.cwd(), ...allpath);
@ -45,9 +43,13 @@ if (!(await existsAsync(dir.path("_tmp_docker")))) {
});
}
}
await copyAsync(dir.path("bun.lockb"), dir.path("_tmp_docker", "bun.lockb"));
await copyAsync(
dir.path("bun.lockb"),
dir.path("_tmp_docker", "bun.lockb")
);
await $({ cwd: dir.path("_tmp_docker") })`zip -r ../docker .`;
await $`mv docker.zip dockerzip`;
await removeAsync(dir.path("_tmp_docker"));
}
}