dify/cli/src/store/dir.ts
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

19 lines
589 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()
}