From fbf04ae079b7cfc14a96903bcfffeb02fc52813d Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:20:15 -0700 Subject: [PATCH] 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. --- apps/desktop/electron/find-git-bash.test.ts | 3 +++ apps/desktop/electron/find-git-bash.ts | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/apps/desktop/electron/find-git-bash.test.ts b/apps/desktop/electron/find-git-bash.test.ts index a8aa28ffb87e..63e00b3c3d68 100644 --- a/apps/desktop/electron/find-git-bash.test.ts +++ b/apps/desktop/electron/find-git-bash.test.ts @@ -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') }) diff --git a/apps/desktop/electron/find-git-bash.ts b/apps/desktop/electron/find-git-bash.ts index a862c5f872fe..62369e9bad6d 100644 --- a/apps/desktop/electron/find-git-bash.ts +++ b/apps/desktop/electron/find-git-bash.ts @@ -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