mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 21:20:29 +08:00
fix: smart core prepare
This commit is contained in:
parent
dab2ead5fd
commit
be7f8677b0
@ -171,19 +171,16 @@ function mihomoSmart() {
|
|||||||
targetFile: `mihomo-smart${isWin ? '.exe' : ''}`,
|
targetFile: `mihomo-smart${isWin ? '.exe' : ''}`,
|
||||||
exeFile,
|
exeFile,
|
||||||
zipFile,
|
zipFile,
|
||||||
downloadURL,
|
downloadURL
|
||||||
useProjectRoot: true // 标记需要使用项目根目录
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* download sidecar and rename
|
* download sidecar and rename
|
||||||
*/
|
*/
|
||||||
async function resolveSidecar(binInfo) {
|
async function resolveSidecar(binInfo) {
|
||||||
const { name, targetFile, zipFile, exeFile, downloadURL, useProjectRoot } = binInfo
|
const { name, targetFile, zipFile, exeFile, downloadURL } = binInfo
|
||||||
|
|
||||||
// 对于 Smart 内核,使用项目根目录而不是 scripts 目录
|
const sidecarDir = path.join(cwd, 'extra', 'sidecar')
|
||||||
const baseDir = useProjectRoot ? path.dirname(cwd) : cwd
|
|
||||||
const sidecarDir = path.join(baseDir, 'extra', 'sidecar')
|
|
||||||
const sidecarPath = path.join(sidecarDir, targetFile)
|
const sidecarPath = path.join(sidecarDir, targetFile)
|
||||||
|
|
||||||
fs.mkdirSync(sidecarDir, { recursive: true })
|
fs.mkdirSync(sidecarDir, { recursive: true })
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user