mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-13 21:57:30 +08:00
fix: add claude code sdk support for arm version windows
- Enhanced the logic to determine included Claude code vendors based on architecture and platform. - Adjusted filters for excluding and including Claude code vendors to improve compatibility, particularly for Windows ARM64. - Removed unnecessary variables and streamlined the filter application process.
This commit is contained in:
parent
2f67b63057
commit
0cb3bd8311
@ -82,23 +82,30 @@ exports.default = async function (context) {
|
||||
|
||||
const arm64Filters = Object.keys(allArm64).map((f) => '!node_modules/' + f + '/**')
|
||||
const x64Filters = Object.keys(allX64).map((f) => '!node_modules/' + f + '/*')
|
||||
const excludeClaudeCodeRipgrepFilters = claudeCodeVenders
|
||||
.filter((f) => f !== `${archType}-${platformToArch[platform]}`)
|
||||
.map((f) => '!node_modules/' + claudeCodeVenderPath + '/ripgrep/' + f + '/**')
|
||||
const excludeClaudeCodeJBPlutins = ['!node_modules/' + claudeCodeVenderPath + '/' + 'claude-code-jetbrains-plugin']
|
||||
|
||||
const includeClaudeCodeFilters = [
|
||||
'!node_modules/' + claudeCodeVenderPath + '/ripgrep/' + `${archType}-${platformToArch[platform]}/**`
|
||||
]
|
||||
// Determine which claudeCodeVenders to include
|
||||
// For Windows ARM64, also include x64-win32 for compatibility
|
||||
const includedClaudeCodeVenders = [`${archType}-${platformToArch[platform]}`]
|
||||
if (platform === 'windows' && arch === Arch.arm64) {
|
||||
includedClaudeCodeVenders.push('x64-win32')
|
||||
}
|
||||
|
||||
const excludeClaudeCodeRipgrepFilters = claudeCodeVenders
|
||||
.filter((f) => !includedClaudeCodeVenders.includes(f))
|
||||
.map((f) => '!node_modules/' + claudeCodeVenderPath + '/ripgrep/' + f + '/**')
|
||||
|
||||
const includeClaudeCodeFilters = includedClaudeCodeVenders.map(
|
||||
(f) => '!node_modules/' + claudeCodeVenderPath + '/ripgrep/' + f + '/**'
|
||||
)
|
||||
|
||||
if (arch === Arch.arm64) {
|
||||
await changeFilters(
|
||||
[...x64Filters, ...excludeClaudeCodeRipgrepFilters, ...excludeClaudeCodeJBPlutins],
|
||||
[...x64Filters, ...excludeClaudeCodeRipgrepFilters],
|
||||
[...arm64Filters, ...includeClaudeCodeFilters]
|
||||
)
|
||||
} else {
|
||||
await changeFilters(
|
||||
[...arm64Filters, ...excludeClaudeCodeRipgrepFilters, ...excludeClaudeCodeJBPlutins],
|
||||
[...arm64Filters, ...excludeClaudeCodeRipgrepFilters],
|
||||
[...x64Filters, ...includeClaudeCodeFilters]
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user