mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
do not copy the substore server file
This commit is contained in:
parent
d2957aebf5
commit
035d573d88
@ -1,6 +1,6 @@
|
|||||||
import { getAppConfig, getControledMihomoConfig } from '../config'
|
import { getAppConfig, getControledMihomoConfig } from '../config'
|
||||||
import { Worker } from 'worker_threads'
|
import { Worker } from 'worker_threads'
|
||||||
import { subStoreDir } from '../utils/dirs'
|
import { resourcesFilesDir, subStoreDir } from '../utils/dirs'
|
||||||
import http from 'http'
|
import http from 'http'
|
||||||
import net from 'net'
|
import net from 'net'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
@ -57,7 +57,7 @@ export async function startSubStoreServer(): Promise<void> {
|
|||||||
if (!useSubStore) return
|
if (!useSubStore) return
|
||||||
if (subStorePort) return
|
if (subStorePort) return
|
||||||
subStorePort = await findAvailablePort(3000)
|
subStorePort = await findAvailablePort(3000)
|
||||||
new Worker(path.join(subStoreDir(), 'sub-store.bundle.js'), {
|
new Worker(path.join(resourcesFilesDir(), 'sub-store.bundle.js'), {
|
||||||
env: {
|
env: {
|
||||||
SUB_STORE_BACKEND_API_PORT: subStorePort.toString(),
|
SUB_STORE_BACKEND_API_PORT: subStorePort.toString(),
|
||||||
SUB_STORE_DATA_BASE_PATH: subStoreDir()
|
SUB_STORE_DATA_BASE_PATH: subStoreDir()
|
||||||
|
|||||||
@ -83,15 +83,7 @@ async function initFiles(): Promise<void> {
|
|||||||
await copyFile(sourcePath, testTargrtPath)
|
await copyFile(sourcePath, testTargrtPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const copySubStore = async (): Promise<void> => {
|
|
||||||
const targetPath = path.join(subStoreDir(), 'sub-store.bundle.js')
|
|
||||||
const sourcePath = path.join(resourcesFilesDir(), 'sub-store.bundle.js')
|
|
||||||
if (existsSync(sourcePath)) {
|
|
||||||
await copyFile(sourcePath, targetPath)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
copySubStore(),
|
|
||||||
copy('country.mmdb'),
|
copy('country.mmdb'),
|
||||||
copy('geoip.dat'),
|
copy('geoip.dat'),
|
||||||
copy('geosite.dat'),
|
copy('geosite.dat'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user