mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 23:08:36 +00:00
A clone of 0.2.15 or earlier runs its own UPDATE.bat. The whole file is one ( ... ) block, so cmd has it in memory, but cmd opens a running .bat file again after each program it calls. The git pull inside it brought the 0.2.16 layout, which had no UPDATE.bat, so after `call START-HERE.bat --update` cmd printed "The batch file cannot be found." twice and the exit code was 1, though the update had finished (USERTEST-WIN K6). The new layout carries a 575-byte UPDATE.bat that calls `START-HERE.bat --update %*` and exits with its code. After the pull the old running file finds a file again; its saved read position (about 4000 bytes, the old file's end) is past the end of the stub, so cmd just ends. It also makes the command people remember work in a new clone. Proof on the owner PC in a scratch folder (cmd only, nothing installed): the real v0.2.15 UPDATE.bat with a fake START-HERE.bat that does what the pull does: without the stub exit 1 and the two error lines, with the stub exit 0 and no error. No update.sh stub: the old update.sh ends with `exec sh ./setup.sh --update` and has no such problem. Tests: terminal/tests/terminal/test_update_bat_stub.py (the reproduction, the fix, the stub run by hand).
8 lines
568 B
Batchfile
8 lines
568 B
Batchfile
@echo off
|
|
rem UPDATE.bat is kept so that the command people know still works, and so that an older clone's own UPDATE.bat can finish.
|
|
rem It does what START-HERE.bat --update does: it gets the newest code (git pull), then updates the engine and the settings.
|
|
rem Why this file must exist: cmd opens a running .bat file again after each program it calls. The pull that brought the 0.2.16
|
|
rem layout used to remove the old UPDATE.bat, and cmd then ended with "The batch file cannot be found." and exit code 1.
|
|
call "%~dp0START-HERE.bat" --update %*
|
|
exit /b %errorlevel%
|