diff options
| author | Dax Raad <[email protected]> | 2025-07-31 09:35:57 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-07-31 09:35:57 -0400 |
| commit | b14da5fb1f56300a99191eaffad37e3add08d63f (patch) | |
| tree | 29bc417005e4a2725b7aa700c8c4e6a33797f08c | |
| parent | 416f2235fcd5676486dbcedb621bbac95846d512 (diff) | |
| download | opencode-b14da5fb1f56300a99191eaffad37e3add08d63f.tar.gz opencode-b14da5fb1f56300a99191eaffad37e3add08d63f.zip | |
ci: tweak
| -rw-r--r-- | packages/opencode/src/global/index.ts | 2 | ||||
| -rw-r--r-- | 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 1e894bf10..87c27af93 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 a0b53876f..a5283fd88 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) |
