dify/cli/src/store/dir.ts
Yunlu Wen c0ee821d45
refactor: use absolute path for inter dir importing (#36822)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-01 01:32:16 +00:00

21 lines
597 B
TypeScript

import { getEnv, resolvePlatform } from '@/sys'
export const ENV_CONFIG_DIR = 'DIFY_CONFIG_DIR'
export const ENV_CACHE_DIR = 'DIFY_CACHE_DIR'
export const FILE_PERM = 0o600
export const DIR_PERM = 0o700
export function resolveCacheDir(): string {
const override = getEnv(ENV_CACHE_DIR)
if (override !== undefined && override !== '')
return override
return resolvePlatform().cacheDir()
}
export function resolveConfigDir(): string {
const override = getEnv(ENV_CONFIG_DIR)
if (override !== undefined && override !== '')
return override
return resolvePlatform().configDir()
}