From b14da5fb1f56300a99191eaffad37e3add08d63f Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 31 Jul 2025 09:35:57 -0400 Subject: [PATCH] ci: tweak --- packages/opencode/src/global/index.ts | 2 ++ packages/opencode/src/util/log.ts | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/opencode/src/global/index.ts b/packages/opencode/src/global/index.ts index 1e894bf1..87c27af9 100644 --- a/packages/opencode/src/global/index.ts +++ b/packages/opencode/src/global/index.ts @@ -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" diff --git a/packages/opencode/src/util/log.ts b/packages/opencode/src/util/log.ts index a0b53876..a5283fd8 100644 --- a/packages/opencode/src/util/log.ts +++ b/packages/opencode/src/util/log.ts @@ -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)