okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221terminal archive: bundled Python for Windows x64 and Linux x86_64, hash-locked wheels, launchers, smoke test66bc88907

main
3.8 KiB82 linesraw
1@echo off
2rem Update Strata without starting the model (#475): the newest code (git pull, when this folder is a git clone), then
3rem what START-HERE.bat does before a start - the engine (a new one when this version needs it), the Python packages,
4rem each installed model's settings and draft subset. The model files are not touched. Start the model later with
5rem START-HERE.bat. Options are passed on to setup.py. The bundled Python (python\ beside this file) is used when
6rem there is one: START-HERE.bat, which this file runs, picks it.
7setlocal
8title Strata - update
9cd /d "%~dp0"
10rem All of it in one block: cmd reads a .bat file while it runs it, and the git pull can change this very file.
11(
12  if exist ".git" (
13    where git >nul 2>nul || (
14      echo  This folder is a git clone, but git is not on PATH: install Git for Windows ^(winget install Git.Git^)
15      echo  or run "git pull" here yourself, then run UPDATE.bat again.
16      pause
17      exit /b 1
18    )
19    echo  Getting the newest Strata ^(git pull^) ...
20    git pull --ff-only
21    if errorlevel 1 (
22      rem The history was rewritten on 2026-10-06, see #1276: a clone from before has no commit in common with origin/main.
23      set "REWR="
24      git merge-base HEAD origin/main >nul 2>nul
25      if errorlevel 1 set "REWR=1"
26      git rev-parse --is-shallow-repository 2>nul | findstr /x true >nul && set "REWR="
27      if defined REWR (
28        echo.
29        echo  This clone is on the repository's old history ^(cleaned up on 2026-10-06^): it has no commit in common
30        echo  with origin/main, so it cannot be updated by git pull.
31        set "DIRTY="
32        for /f "delims=" %%i in ('git status --porcelain --untracked-files^=no') do set "DIRTY=1"
33        if defined DIRTY (
34          echo  You have local changes to tracked files here, so nothing was touched. To move to the new history
35          echo  yourself ^(your untracked files, models and settings stay where they are^):
36          echo    git branch pre-cleanup-backup
37          echo    git stash push
38          echo    git checkout -B main origin/main
39          echo  then run UPDATE.bat again.
40          pause
41          exit /b 1
42        )
43        set "BK=pre-cleanup-backup"
44        git rev-parse --verify -q refs/heads/pre-cleanup-backup >nul 2>nul && set "BK=pre-cleanup-backup-%RANDOM%"
45        set "BR=main"
46        for /f "delims=" %%i in ('git symbolic-ref --short -q HEAD 2^>nul') do set "BR=%%i"
47        call git branch %%BK%% HEAD
48        if errorlevel 1 (
49          echo  Could not make the backup branch: nothing was updated.
50          pause
51          exit /b 1
52        )
53        call git checkout -q -B %%BR%% origin/main
54        if errorlevel 1 (
55          call git branch -D %%BK%% >nul 2>nul
56          echo.
57          echo  Could not move to the new history ^(the reason is above^): nothing was updated. By hand:
58          echo    git checkout -B main origin/main
59          pause
60          exit /b 1
61        )
62        call echo  Moved to the new history. Your old commits are kept in the branch %%BK%%.
63        echo  Untracked files ^(models, settings, the engine^) were not touched.
64      ) else (
65        echo.
66        echo  git pull did not succeed ^(the reason is above^): nothing was updated. Files you changed here can stop it:
67        echo  "git status" lists them.
68        pause
69        exit /b 1
70      )
71    )
72  ) else (
73    echo  This copy of Strata was not made with git, so it cannot fetch new files itself. Download the newest one:
74    echo    https://github.com/Niko1221/Strata/archive/refs/heads/main.zip
75    echo  unzip it anywhere and run START-HERE.bat ^(or UPDATE.bat^) in it: it finds the model files in Strata-data
76    echo  and sets itself up the same way - nothing big is downloaded again.
77    echo  Checking this copy's engine and settings meanwhile ...
78  )
79  call "%~dp0START-HERE.bat" --update %*
80  if not errorlevel 1 pause
81  exit /b
82)