mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 22:32:28 +00:00
25 lines
533 B
TypeScript
25 lines
533 B
TypeScript
import fs from "fs/promises"
|
|
import { xdgData, xdgCache, xdgConfig } from "xdg-basedir"
|
|
import path from "path"
|
|
|
|
const app = "opencode"
|
|
|
|
const data = path.join(xdgData!, app)
|
|
const cache = path.join(xdgCache!, app)
|
|
const config = path.join(xdgConfig!, app)
|
|
|
|
await Promise.all([
|
|
fs.mkdir(data, { recursive: true }),
|
|
fs.mkdir(config, { recursive: true }),
|
|
fs.mkdir(cache, { recursive: true }),
|
|
])
|
|
|
|
export namespace Global {
|
|
export const Path = {
|
|
data,
|
|
bin: path.join(data, "bin"),
|
|
cache,
|
|
config,
|
|
} as const
|
|
}
|