support global config for providers

This commit is contained in:
Dax Raad
2025-06-17 12:10:44 -04:00
parent ee91f31313
commit d579c5e8aa
4 changed files with 84 additions and 22 deletions

View File

@@ -8,17 +8,19 @@ 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"),
providers: path.join(config, "providers"),
cache,
config,
} as const
}
await Promise.all([
fs.mkdir(data, { recursive: true }),
fs.mkdir(config, { recursive: true }),
fs.mkdir(cache, { recursive: true }),
fs.mkdir(Global.Path.providers, { recursive: true }),
])