fix: sub-store temp dir

This commit is contained in:
miwu04 2025-04-18 22:04:44 +08:00
parent a6a3afd3bb
commit 6cb432dea9

View File

@ -1,6 +1,12 @@
import { getAppConfig, getControledMihomoConfig } from '../config' import { getAppConfig, getControledMihomoConfig } from '../config'
import { Worker } from 'worker_threads' import { Worker } from 'worker_threads'
import { mihomoWorkDir, resourcesFilesDir, subStoreDir, substoreLogPath } from '../utils/dirs' import {
dataDir,
mihomoWorkDir,
resourcesFilesDir,
subStoreDir,
substoreLogPath
} from '../utils/dirs'
import subStoreIcon from '../../../resources/subStoreIcon.png?asset' import subStoreIcon from '../../../resources/subStoreIcon.png?asset'
import { createWriteStream, existsSync, mkdirSync } from 'fs' import { createWriteStream, existsSync, mkdirSync } from 'fs'
import { writeFile, rm, cp } from 'fs/promises' import { writeFile, rm, cp } from 'fs/promises'
@ -147,7 +153,7 @@ export async function downloadSubStore(): Promise<void> {
const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig() const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig()
const frontendDir = path.join(resourcesFilesDir(), 'sub-store-frontend') const frontendDir = path.join(resourcesFilesDir(), 'sub-store-frontend')
const backendPath = path.join(resourcesFilesDir(), 'sub-store.bundle.js') const backendPath = path.join(resourcesFilesDir(), 'sub-store.bundle.js')
const tempDir = path.join(resourcesFilesDir(), 'temp') const tempDir = path.join(dataDir(), 'temp')
const execFilePromise = promisify(execFile) const execFilePromise = promisify(execFile)
try { try {