mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-24 16:54:43 +00:00
style(desktop): apply eslint/prettier conventions to find-git-bash module
npx eslint --fix + prettier --write on the new files: braces on single-line if returns and blank-line padding per the desktop lint config.
This commit is contained in:
parent
6c2c866a9a
commit
fbf04ae079
2 changed files with 14 additions and 3 deletions
|
|
@ -14,6 +14,7 @@ test('HERMES_GIT_BASH_PATH override takes precedence', () => {
|
|||
fileExists: yes,
|
||||
findOnPath: () => null
|
||||
})
|
||||
|
||||
assert.equal(result, 'D:\\CustomGit\\bin\\bash.exe')
|
||||
})
|
||||
|
||||
|
|
@ -37,6 +38,7 @@ test('HERMES_GIT_BASH_PATH empty string is ignored', () => {
|
|||
fileExists: no,
|
||||
findOnPath: () => 'C:\\msys64\\usr\\bin\\bash.exe'
|
||||
})
|
||||
|
||||
assert.equal(result, 'C:\\msys64\\usr\\bin\\bash.exe')
|
||||
})
|
||||
|
||||
|
|
@ -47,5 +49,6 @@ test('non-Windows uses findOnPath', () => {
|
|||
fileExists: no,
|
||||
findOnPath: () => '/usr/bin/bash'
|
||||
})
|
||||
|
||||
assert.equal(result, '/usr/bin/bash')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -25,7 +25,10 @@ export function findGitBash(opts: GitBashOptions): string | null {
|
|||
|
||||
// Respect HERMES_GIT_BASH_PATH if set (mirrors tools/environments/local.py:_find_bash).
|
||||
const gitBashPath = env.HERMES_GIT_BASH_PATH
|
||||
if (gitBashPath && fileExists(gitBashPath)) return gitBashPath
|
||||
|
||||
if (gitBashPath && fileExists(gitBashPath)) {
|
||||
return gitBashPath
|
||||
}
|
||||
|
||||
const localAppData = env.LOCALAPPDATA || ''
|
||||
const candidates: string[] = []
|
||||
|
|
@ -47,12 +50,17 @@ export function findGitBash(opts: GitBashOptions): string | null {
|
|||
}
|
||||
|
||||
for (const candidate of candidates) {
|
||||
if (fileExists(candidate)) return candidate
|
||||
if (fileExists(candidate)) {
|
||||
return candidate
|
||||
}
|
||||
}
|
||||
|
||||
if (findOnPath) {
|
||||
const onPath = findOnPath('bash')
|
||||
if (onPath) return onPath
|
||||
|
||||
if (onPath) {
|
||||
return onPath
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue