mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-11 04:00:32 +08:00
fix: improve sidecar path lookup for dev environment
This commit is contained in:
parent
026d9d30f9
commit
b071154263
@ -48,10 +48,10 @@ function getResourcesPath() {
|
|||||||
if (process.resourcesPath) {
|
if (process.resourcesPath) {
|
||||||
return process.resourcesPath
|
return process.resourcesPath
|
||||||
}
|
}
|
||||||
// 开发环境:从 __dirname 向上查找项目根目录
|
// 开发环境:查找包含 extra/sidecar 的目录
|
||||||
let currentDir = __dirname
|
let currentDir = __dirname
|
||||||
while (currentDir !== dirname(currentDir)) {
|
while (currentDir !== dirname(currentDir)) {
|
||||||
if (existsSync(join(currentDir, 'package.json'))) {
|
if (existsSync(join(currentDir, 'extra', 'sidecar'))) {
|
||||||
return currentDir
|
return currentDir
|
||||||
}
|
}
|
||||||
currentDir = dirname(currentDir)
|
currentDir = dirname(currentDir)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user