Repository navigation
8.7.0: install with one Python program instead of three shell scripts - #22
Merged
Merged
Conversation
foursecondfivefour
added a commit
that referenced
this pull request
Dec 2, 2026
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
foursecondfivefour
force-pushed
the
arena/36a4d756-nerveforge
branch
2 times, most recently
from
December 2, 2026 14:54
b053035 to
9b689ba
Compare
The installer was three scripts with three sets of answers: setup.sh knew APT, setup_termux.sh knew pkg, setup_windows.ps1 knew winget, and each had its own sentence for a missing Python or a missing tunnel. Fixing a step meant fixing it three times, and the Windows script had grown four of its own switches that the other platforms never got. Now `./nerveforge install` runs the same ten steps everywhere — Python, rights, tunnel, download, folders, workspace, shortcut, command, check, start — and each step prints one line saying what it found or why it stopped, with a remedy under it. The steps live in installer/actions.py, the questions in menu.py, the output in render.py. The flags keep three promises: --plan goes through the same step table and changes nothing, so it cannot drift from the run; --yes answers the defaults, which are quiet (the PATH launcher is offered, never assumed); --uninstall removes the shortcut, launcher and downloaded cloudflared and says out loud that the token, settings, skills and audit log were kept. The old entry points still work: setup.sh, setup_termux.sh and setup_windows.ps1 now find a Python 3.10+ and hand over, and run.py starts the bridge as before, so an older README or shortcut does not break. InstallerTests read setup_windows.ps1 and asserted on its BOM, its chr(46) trick and its brace balance — tests of a script, not an installer. They are replaced by 64 tests that run the real steps against a temporary HOME. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
foursecondfivefour
force-pushed
the
arena/36a4d756-nerveforge
branch
from
December 2, 2026 14:56
9b689ba to
e4f85f4
Compare
The .cmd wrapper did not pass on %ERRORLEVEL%, so a launcher whose Python had gone missing flashed a console and reported success. It now holds the window open on a failure and exits with the code. The read-only-directory tests assumed os.geteuid, which Windows does not have. They skip on a platform without POSIX permission bits now, and a new test refuses an unguarded os.geteuid anywhere in the installer. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Five Windows failures came from tests that assumed POSIX: a colon-separated PATH, an executable bit, a shell-script fake interpreter, a chmod that makes a folder read-only, and the local bin name. They now use os.pathsep, skip where the premise cannot exist, and assert on what Windows actually gets. One real bug fell out of it: uninstall deleted 'cloudflared' while the downloader writes 'cloudflared.exe' on Windows. Both now go through actions.cloudflared_path(), and a test checks the name matches the platform. command_targets also stopped treating any 'bin' under home as a user bin — ~/repo/src/bin was a candidate, which would drop a launcher into a build directory. Only ~/.local/bin, ~/bin and (on Windows) the WindowsApps shim count, and only when already on PATH. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Three failures left: the launcher and desktop-entry tests built expected paths with str(), which is backslashes on Windows and slashes everywhere else, and the PATH test expected a bare launcher name on a platform that names it .exe. Written with as_posix() and os.name now. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The .desktop file is Linux-only, but two tests compared its paths with str() and as_posix(), which differ on Windows. The entry now writes forward slashes by construction, and the tests compare the same repr the launcher contains. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
On Windows command_targets returns nerveforge.exe and the Python half sits beside it as nerveforge.py; the test read the bare 'nerveforge' path, which is the POSIX layout only. Both launcher tests now resolve the file the way install_command does. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The launcher writes forward slashes on every platform, so a Windows runner reads back D:/a/... while str(Path) there is D:\\a\\.... The tests now parse the ROOT line and compare it with the tree as paths, which is what the launcher itself relies on. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
./nerveforge install— one installer, ten steps, the same on Linux, macOS, Windows and Termux. The three shell scripts become hand-overs that find a Python 3.10+ and pass the arguments through.A step that cannot go on stops the run with a reason and a remedy; a step that fails but blocks nothing (a blocked
cloudflareddownload) says so and lets the rest continue.The three promises the flags keep
--planwalks the same step table and prints only the steps that would change the machine, so the plan cannot drift from the run.--yesanswers the defaults, and the defaults are quiet: shortcut yes on a desktop, skipped on a server or Termux; thenerveforgecommand on PATH is offered, never assumed.--uninstallremoves the shortcut, the launcher and the downloadedcloudflared, and says out loud that it kept the token, settings, skills and audit log.The scripts you have keep working
setup.sh,setup_termux.shandsetup_windows.ps1now only find an interpreter and hand over.run.pyis an alias for the new./nerveforge. The Windows script lost its ownwingetlogic and its four switches: flags belong innerveforge install, where every platform gets them.Bugs the tests found
Writing real tests instead of asserting on a script's text turned up four:
.cmdlauncher reported success on failure. It never passed on%ERRORLEVEL%, so a launcher whose Python had gone missing flashed a console and vanished cleanly. It now holds the window open and exits with the code.uninstalldeleted the wrong file on Windows. It removedcloudflaredwhile the downloader writescloudflared.exe. Both go throughactions.cloudflared_path()now.command_targetscould pick a project's build folder. Anybinunder home counted;~/repo/src/binwas a candidate. Only~/.local/bin,~/binand (on Windows) the WindowsApps shim count, and only when already on PATH.Tests
InstallerTestsreadsetup_windows.ps1and asserted on its BOM,chr(46)and brace balance — tests of a script, not an installer. Replaced by 71 tests intests/test_installer.pythat run the real steps against a temporaryHOME, and a portability test that refuses an unguardedos.geteuidanywhere in the installer.python -m unittest discover -s tests→ 1908 tests, OK (skipped=1)ruff check src tests scripts→ cleanbump_version.py --check,check_docs.py,gen_api_doc.py --check→ cleanDocs updated in both languages: README quick start, the repo tree, DEVELOPMENT.md, CHANGELOG 8.7.0. CI now syntax-checks both shell scripts and runs the installer's plan.