fix: ensure Z.AI config directory exists before writing
Some checks failed
Release Binaries / release (push) Has been cancelled
Some checks failed
Release Binaries / release (push) Has been cancelled
This commit is contained in:
@@ -361,6 +361,10 @@ function getZAIConfig(): ZAIConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateZAIConfig(config: Partial<ZAIConfig>): void {
|
function updateZAIConfig(config: Partial<ZAIConfig>): void {
|
||||||
|
// Ensure directory exists
|
||||||
|
if (!existsSync(CONFIG_DIR)) {
|
||||||
|
mkdirSync(CONFIG_DIR, { recursive: true })
|
||||||
|
}
|
||||||
const current = getZAIConfig()
|
const current = getZAIConfig()
|
||||||
const updated = { ...current, ...config }
|
const updated = { ...current, ...config }
|
||||||
writeFileSync(CONFIG_FILE, JSON.stringify(updated, null, 2))
|
writeFileSync(CONFIG_FILE, JSON.stringify(updated, null, 2))
|
||||||
|
|||||||
Reference in New Issue
Block a user