ci: tweak

This commit is contained in:
Dax Raad
2025-07-31 09:35:57 -04:00
parent 416f2235fc
commit b14da5fb1f
2 changed files with 4 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ export namespace Global {
export const Path = {
data,
bin: path.join(data, "bin"),
log: path.join(data, "log"),
cache,
config,
state,
@@ -23,6 +24,7 @@ await Promise.all([
fs.mkdir(Global.Path.data, { recursive: true }),
fs.mkdir(Global.Path.config, { recursive: true }),
fs.mkdir(Global.Path.state, { recursive: true }),
fs.mkdir(Global.Path.log, { recursive: true }),
])
const CACHE_VERSION = "3"

View File

@@ -53,12 +53,10 @@ export namespace Log {
export async function init(options: Options) {
if (options.level) level = options.level
const dir = path.join(Global.Path.data, "log")
await fs.mkdir(dir, { recursive: true })
cleanup(dir)
cleanup(Global.Path.log)
if (options.print) return
logpath = path.join(
dir,
Global.Path.log,
options.dev ? "dev.log" : new Date().toISOString().split(".")[0].replace(/:/g, "") + ".log",
)
const logfile = Bun.file(logpath)