mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
Fix Windows packaged Orca CLI launcher path resolution (#282)
This commit is contained in:
parent
1c6d5a1fa0
commit
46070d8f27
2 changed files with 18 additions and 1 deletions
|
|
@ -2,7 +2,11 @@
|
|||
setlocal
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
for %%I in ("%SCRIPT_DIR%..") do set "RESOURCES_DIR=%%~fI"
|
||||
for %%I in ("%RESOURCES_DIR%..") do set "APP_DIR=%%~fI"
|
||||
REM Why: once %%~fI canonicalizes RESOURCES_DIR it no longer ends with a slash,
|
||||
REM so Windows batch needs an explicit "\.." segment here. Without it the CLI
|
||||
REM launcher resolves APP_DIR back to resources/ and `orca open` cannot find
|
||||
REM Orca.exe on packaged Windows installs.
|
||||
for %%I in ("%RESOURCES_DIR%\..") do set "APP_DIR=%%~fI"
|
||||
set "ELECTRON=%APP_DIR%\Orca.exe"
|
||||
|
||||
if not exist "%ELECTRON%" (
|
||||
|
|
|
|||
13
src/main/cli/windows-launcher-asset.test.ts
Normal file
13
src/main/cli/windows-launcher-asset.test.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { readFileSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
describe('packaged Windows CLI launcher asset', () => {
|
||||
it('walks from resources/bin back to the app root before locating Orca.exe', () => {
|
||||
const launcherPath = join(process.cwd(), 'resources', 'win32', 'bin', 'orca.cmd')
|
||||
const launcher = readFileSync(launcherPath, 'utf8')
|
||||
|
||||
expect(launcher).toContain('for %%I in ("%RESOURCES_DIR%\\..") do set "APP_DIR=%%~fI"')
|
||||
expect(launcher).not.toContain('for %%I in ("%RESOURCES_DIR%..") do set "APP_DIR=%%~fI"')
|
||||
})
|
||||
})
|
||||
Loading…
Reference in a new issue