Skip to content

Commit d42c994

Browse files
newbe36524Copilot
andcommitted
fix: repair omniroute powershell wrapper
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ab00308 commit d42c994

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/omniroute/scripts/build-artifacts.test.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,11 @@ test("writePlatformWrappers emits archive-relative Windows wrappers for every co
126126
assert.match(cmdWrapper, /set "SCRIPT_DIR=%~dp0"/)
127127
assert.match(cmdWrapper, /%SCRIPT_DIR%bin\\reset-password\.mjs/)
128128
assert.doesNotMatch(cmdWrapper, new RegExp(releaseRoot.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")))
129+
130+
const ps1Wrapper = await readFile(path.join(releaseRoot, "omniroute.ps1"), "utf8")
131+
assert.match(ps1Wrapper, /\$scriptDir = \$PSScriptRoot/)
132+
assert.match(ps1Wrapper, /\$target = Join-Path \$scriptDir 'bin\\omniroute\.mjs'/)
133+
assert.doesNotMatch(ps1Wrapper, /Split-Path -LiteralPath/)
129134
})
130135

131136
test("writePlatformWrappers emits executable Unix shell wrappers", async () => {

packages/omniroute/scripts/wrappers.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ node "%SCRIPT_DIR%${windowsRelativeEntrypoint}" %*
6464
exit /b %ERRORLEVEL%
6565
`
6666
case ".ps1":
67-
return `$scriptDir = Split-Path -LiteralPath $MyInvocation.MyCommand.Path -Parent
67+
return `$scriptDir = $PSScriptRoot
6868
$target = Join-Path $scriptDir '${escapePowerShellLiteral(windowsRelativeEntrypoint)}'
6969
& node $target @args
7070
exit $LASTEXITCODE

0 commit comments

Comments
 (0)