mirror of
https://github.com/stablyai/orca.git
synced 2026-09-21 16:02:20 +00:00
Fix Windows packaged Orca CLI launcher path resolution (#282)
This commit is contained in:
@@ -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%" (
|
||||
|
||||
@@ -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"')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user