mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-28 15:09:19 +00:00
fix: support service runtime fallbacks
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { app } from 'electron'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import { getPathFallback } from './electronRuntime'
|
||||
|
||||
export interface ExportRecord {
|
||||
exportTime: number
|
||||
@@ -20,7 +20,7 @@ class ExportRecordService {
|
||||
private resolveFilePath(): string {
|
||||
if (this.filePath) return this.filePath
|
||||
const workerUserDataPath = String(process.env.WEFLOW_USER_DATA_PATH || process.env.WEFLOW_CONFIG_CWD || '').trim()
|
||||
const userDataPath = workerUserDataPath || app?.getPath?.('userData') || process.cwd()
|
||||
const userDataPath = workerUserDataPath || getPathFallback('userData')
|
||||
fs.mkdirSync(userDataPath, { recursive: true })
|
||||
this.filePath = path.join(userDataPath, 'weflow-export-records.json')
|
||||
return this.filePath
|
||||
|
||||
Reference in New Issue
Block a user