mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
ci: tweak
This commit is contained in:
@@ -13,6 +13,7 @@ export namespace Global {
|
|||||||
export const Path = {
|
export const Path = {
|
||||||
data,
|
data,
|
||||||
bin: path.join(data, "bin"),
|
bin: path.join(data, "bin"),
|
||||||
|
log: path.join(data, "log"),
|
||||||
cache,
|
cache,
|
||||||
config,
|
config,
|
||||||
state,
|
state,
|
||||||
@@ -23,6 +24,7 @@ await Promise.all([
|
|||||||
fs.mkdir(Global.Path.data, { recursive: true }),
|
fs.mkdir(Global.Path.data, { recursive: true }),
|
||||||
fs.mkdir(Global.Path.config, { recursive: true }),
|
fs.mkdir(Global.Path.config, { recursive: true }),
|
||||||
fs.mkdir(Global.Path.state, { recursive: true }),
|
fs.mkdir(Global.Path.state, { recursive: true }),
|
||||||
|
fs.mkdir(Global.Path.log, { recursive: true }),
|
||||||
])
|
])
|
||||||
|
|
||||||
const CACHE_VERSION = "3"
|
const CACHE_VERSION = "3"
|
||||||
|
|||||||
@@ -53,12 +53,10 @@ export namespace Log {
|
|||||||
|
|
||||||
export async function init(options: Options) {
|
export async function init(options: Options) {
|
||||||
if (options.level) level = options.level
|
if (options.level) level = options.level
|
||||||
const dir = path.join(Global.Path.data, "log")
|
cleanup(Global.Path.log)
|
||||||
await fs.mkdir(dir, { recursive: true })
|
|
||||||
cleanup(dir)
|
|
||||||
if (options.print) return
|
if (options.print) return
|
||||||
logpath = path.join(
|
logpath = path.join(
|
||||||
dir,
|
Global.Path.log,
|
||||||
options.dev ? "dev.log" : new Date().toISOString().split(".")[0].replace(/:/g, "") + ".log",
|
options.dev ? "dev.log" : new Date().toISOString().split(".")[0].replace(/:/g, "") + ".log",
|
||||||
)
|
)
|
||||||
const logfile = Bun.file(logpath)
|
const logfile = Bun.file(logpath)
|
||||||
|
|||||||
Reference in New Issue
Block a user