Skip to content

Commit 8d19dd4

Browse files
committed
addressing codex review
1 parent 8545d13 commit 8d19dd4

5 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/infra/exec-wrapper-resolution.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,14 @@ describe("extractShellWrapperCommand", () => {
521521
command: "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA",
522522
},
523523
},
524+
{
525+
argv: ["pwsh", "-if", "XML", "-EncodedCommand", "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA"],
526+
expectedInline: "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA",
527+
expectedCommand: {
528+
isWrapper: true,
529+
command: "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA",
530+
},
531+
},
524532
{
525533
argv: ["pwsh", "script.ps1", "-en", "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA"],
526534
expectedInline: null,

src/infra/shell-inline-command.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ describe("resolveInlineCommandMatch", () => {
142142
],
143143
expected: { command: "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA", valueTokenIndex: 4 },
144144
},
145+
{
146+
name: "skips PowerShell input format alias values before encoded-command prefixes",
147+
argv: ["pwsh", "-if", "XML", "-EncodedCommand", "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA"],
148+
expected: { command: "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA", valueTokenIndex: 4 },
149+
},
145150
{
146151
name: "extracts PowerShell slash switch forms before script file binding",
147152
argv: ["pwsh", "/ec", "VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA"],

src/infra/shell-inline-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const POWERSHELL_OPTIONS_WITH_SEPARATE_VALUES = new Set([
3333
...expandPowerShellSwitchPrefixForms("version", "v"),
3434
...expandPowerShellSwitchPrefixForms("windowstyle", "w"),
3535
...expandPowerShellSwitchPrefixForms("workingdirectory", "w"),
36-
...expandPowerShellSwitchForms(["ea", "ep", "of", "wd"]),
36+
...expandPowerShellSwitchForms(["ea", "ep", "if", "of", "wd"]),
3737
]);
3838

3939
const POSIX_SHELL_OPTIONS_WITH_SEPARATE_VALUES = new Set([

src/infra/system-run-command.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ describe("system run command helpers", () => {
8181
{ argv: ["pwsh", "-en", "ZQBjAGgAbwA="], expected: "ZQBjAGgAbwA=" },
8282
{ argv: ["pwsh", "/NoProfile", "/ec", "ZQBjAGgAbwA="], expected: "ZQBjAGgAbwA=" },
8383
{ argv: ["pwsh", "-win", "hidden", "/ec", "ZQBjAGgAbwA="], expected: "ZQBjAGgAbwA=" },
84+
{ argv: ["pwsh", "-if", "XML", "-EncodedCommand", "ZQBjAGgAbwA="], expected: "ZQBjAGgAbwA=" },
8485
{ argv: ["busybox", "sh", "-c", "echo hi"], expected: "echo hi" },
8586
{ argv: ["toybox", "ash", "-c", "echo hi"], expected: "echo hi" },
8687
])("extractShellCommandFromArgv unwraps %j", ({ argv, expected }) => {

src/node-host/invoke-system-run.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,8 @@ describe("handleSystemRunInvoke mac app exec host routing", () => {
770770
executablePath,
771771
"-win",
772772
"hidden",
773+
"-if",
774+
"XML",
773775
"/NoProfile",
774776
"/ec",
775777
"VwByAGkAdABlAC0ATwB1AHQAcAB1AHQAIABoAGkA",

0 commit comments

Comments
 (0)