Files
opencode/packages/opencode/src/global/index.ts
2025-06-03 14:46:28 -04:00

24 lines
500 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,
cache,
config,
} as const
}