play.ps1: paths with square brackets are looked up literally #580

Open
github-bot wants to merge 1 commit from github-bot/gh-580 into a-publier AGit
Owner

@⁠AccelArch on GitHub · 2026-11-27 12:20 UTC · original
AccelArch:play-ps1-literal-path → a-publier · +4 −4 · 1 files · 1 commits · open

scripts/play.ps1 looks up the executable, the victory.exe build and the repository folder with Test-Path, Resolve-Path and Push-Location. Their -Path parameter treats [ and ] as wildcards, so a path such as C:\Games\Game [Steam]\game.exe, or a clone in a folder like D:\VIctory [AMD], is reported as missing ("No ...game.exe." or "No ...victory.exe. Build it first (README.md).") although it exists.

This passes those four paths with -LiteralPath. Nothing else changes (4 lines, CRLF kept).

Tested

Windows PowerShell 5.1.26100, with a stand-in victory.exe (a small program that prints its arguments and returns the exit code from STANDIN_EXIT), running the base script and this one with every combination of a plain or bracketed repository folder (...\scripts\play.ps1 under a plain folder or under Dir [AMD]) and a plain or bracketed executable path (My Copy\game.exe, Game [Steam]\game.exe):

  • base: the plain/plain case starts the program; the three cases with a bracket stop at the "No ..." message;
  • this change: all four start the program, the executable path reaches it unchanged (run|...\Game [Steam]\game.exe|--execute), and the exit code of the program (7 in the test) is still returned.

The game was not run and no Rust was built.

Overlap

#389 and #403 already use -LiteralPath on these lines inside larger changes, and #563 changes nearby lines. Whichever lands second needs a rebase; I can rebase this on top of any of them.

AI-assisted.

**@⁠AccelArch** on GitHub · 2026-11-27 12:20 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/580) `AccelArch:play-ps1-literal-path` → `a-publier` · +4 −4 · 1 files · 1 commits · open `scripts/play.ps1` looks up the executable, the `victory.exe` build and the repository folder with `Test-Path`, `Resolve-Path` and `Push-Location`. Their `-Path` parameter treats `[` and `]` as wildcards, so a path such as `C:\Games\Game [Steam]\game.exe`, or a clone in a folder like `D:\VIctory [AMD]`, is reported as missing ("No ...game.exe." or "No ...victory.exe. Build it first (README.md).") although it exists. This passes those four paths with `-LiteralPath`. Nothing else changes (4 lines, CRLF kept). ## Tested Windows PowerShell 5.1.26100, with a stand-in `victory.exe` (a small program that prints its arguments and returns the exit code from `STANDIN_EXIT`), running the base script and this one with every combination of a plain or bracketed repository folder (`...\scripts\play.ps1` under a plain folder or under `Dir [AMD]`) and a plain or bracketed executable path (`My Copy\game.exe`, `Game [Steam]\game.exe`): - base: the plain/plain case starts the program; the three cases with a bracket stop at the "No ..." message; - this change: all four start the program, the executable path reaches it unchanged (`run|...\Game [Steam]\game.exe|--execute`), and the exit code of the program (7 in the test) is still returned. The game was not run and no Rust was built. ## Overlap #389 and #403 already use `-LiteralPath` on these lines inside larger changes, and #563 changes nearby lines. Whichever lands second needs a rebase; I can rebase this on top of any of them. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 12:22:32 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/580/head:github-bot/gh-580'
git switch 'github-bot/gh-580'

Merge

Merge the changes and update on Forgejo.
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-580'
git switch 'github-bot/gh-580'
git rebase 'a-publier'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-580'
git switch 'github-bot/gh-580'
git rebase 'a-publier'
git switch 'a-publier'
git merge --no-ff 'github-bot/gh-580'
git switch 'a-publier'
git merge --squash 'github-bot/gh-580'
git switch 'a-publier'
git merge --ff-only 'github-bot/gh-580'
git switch 'a-publier'
git merge 'github-bot/gh-580'
git push origin 'a-publier'
This discussion has been locked. Commenting is limited to contributors.
No description provided.