Launcher: stop when the cache or save directory cannot be created #53
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/53"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T06:25:13Z.
On
90b529f, passing an existing file as-Dataletsplay.ps1start the child and report success even though the requested save directory doesn't exist. The same happens with-Cache, or when a parent component is a file.The launcher now prepares each directory with terminating error handling and checks that the literal path names a directory before starting the child. The literal check also handles paths containing brackets.
I tested the original and patched scripts with PowerShell 7.7 on Linux and a stand-in executable that records whether it was launched. Five configurations failed to provide a directory: a file at either final path, a file in either parent path, and a save directory under an unwritable parent. The original launched the child and returned 0 in all five. The patch returned 1 in all five, preserved existing files, and stopped before launching the child. Default, existing, nested and relative paths with spaces and brackets worked, as did a retry with a valid path.
This covers setup before launch. #15 handles the exit code after the child runs, and #17 handles locating the executable. Windows PowerShell 5.1 remains to be tested.
Imported from Zettrox/ztrx. Originally posted by IIKurumiII on 2026-11-25T09:06:50Z.
Tested
90b529fand PR commit733efbdon Windows PowerShell5.1.26100.9711using a stand-in program that records each launch. I tried four cases: a file at the cache path, a file at the save path, and a file blocking a parent directory of each.On
90b529f, all four cases launched the program and returned0. On733efbd, all four returned1without launching it, and the blocking file kept its contents. Retrying with valid cache and save paths containing spaces and brackets launched successfully and returned0.Imported from Zettrox/ztrx. Originally posted by Yoshi-233 on 2026-11-25T11:59:47Z.
Thanks for the Windows reproduction. I independently confirmed the four blocked cache/save path cases on Windows PowerShell 5.1.26100.9711. The additional case I checked was how this change interacts with #15.
I combined
733efbdandafe450aagainst90b529fand ran the launcher twice with the same cache and save paths. With a regular file at the save path, the caller got exit code1, the file kept its contents, and the stand-in executable never ran. After I removed the blocking file and retried, the launcher created the directory, ran the stand-in, and propagated its exit code7.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.