mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-05-13 16:24:43 +00:00
Compare commits
4 Commits
fix/regex-
...
fix/fix-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c07fef6d3 | ||
|
|
e6be3528cc | ||
|
|
c50351ee59 | ||
|
|
9063918c1f |
@@ -33,20 +33,6 @@ test('resolveClaudeCodeExecutablePath keeps an explicit JavaScript launcher path
|
|||||||
assert.equal(resolved, scriptPath);
|
assert.equal(resolved, scriptPath);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('resolveClaudeCodeExecutablePath can parse a wrapper file path containing letters r and n before claude.exe', () => {
|
|
||||||
const wrapperPath = 'C:\\tools\\claude';
|
|
||||||
const nativePath = 'C:\\tools\\custom\\bin\\node_modules\\@anthropic-ai\\claude-code\\bin\\claude.exe';
|
|
||||||
const readFileSync = (() => `exec "$basedir/custom/bin/node_modules/@anthropic-ai/claude-code/bin/claude.exe" "$@"`) as unknown as ResolveClaudeCodeExecutablePathDependencies['readFileSync'];
|
|
||||||
|
|
||||||
const resolved = resolveClaudeCodeExecutablePath(wrapperPath, {
|
|
||||||
platform: 'win32',
|
|
||||||
existsSync: (candidate) => candidate === nativePath,
|
|
||||||
readFileSync,
|
|
||||||
});
|
|
||||||
|
|
||||||
assert.equal(resolved, nativePath);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('resolveClaudeCodeExecutablePath falls back to the configured command when PATH lookup fails', () => {
|
test('resolveClaudeCodeExecutablePath falls back to the configured command when PATH lookup fails', () => {
|
||||||
const execFileSync = (() => {
|
const execFileSync = (() => {
|
||||||
throw new Error('not found');
|
throw new Error('not found');
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ function resolveClaudeWrapperBinary(
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const matches = content.matchAll(/["']([^"'\\\r\n]*claude\.exe)["']/gi);
|
const matches = content.matchAll(/["']([^"'\\r\\n]*claude\.exe)["']/gi);
|
||||||
for (const match of matches) {
|
for (const match of matches) {
|
||||||
const rawTarget = match[1]
|
const rawTarget = match[1]
|
||||||
.replace(/^\$basedir[\\/]/i, '')
|
.replace(/^\$basedir[\\/]/i, '')
|
||||||
|
|||||||
Reference in New Issue
Block a user