Repository navigation
build: one double-click brings this PC's tools up to date (update-local.cmd) - #121
Merged
Merged
Conversation
…al.cmd) GitHub can't update the owner's PC, so update-local.cmd runs tools/update-local.ps1, which brings it to what CI uses, by CI's rule (a release counts once it is 5 days old; tools/newest-release.mjs, on tools/check-toolchain.mjs's helpers): - Node.js of the major .nvmrc names: nodejs.org's MSI, checked against its SHASUMS256.txt, installed with an admin prompt; a newer major is kept; - npm's newest release, and at least the pnpm version package.json pins (both global, %APPDATA%\npm); - on main with nothing uncommitted: git pull --ff-only, pnpm install --frozen-lockfile into the store node_modules was installed from, and fsaunpack's npm ci (scripts off); - the mpv helper again (native-host/install.ps1, with the installed mpv and Node paths) when the repository's host differs from the installed one. Never Firefox, mpv (C:\Program Files\mpv is the owner's own repository with its own updater) or WSL. -DryRun only says what it would do; -Repo points it at another checkout. A failed step is reported and the rest still run. Run for real on this PC against the main checkout: pulled to 6018d62, installed into V:\.pnpm-store, fsaunpack installed, and the mpv helper reinstalled (#109 had changed the host): it answers a ping through its .bat with its mpv path. tests/unit/updateLocal.test.mjs: the version picks, and the script is ASCII and parses in Windows PowerShell. .cmd files check out with CRLF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ature Windows PowerShell 5.1 turns a native command stderr line into a terminating error when output is redirected (the git pull report, npm warnings): its steps reported failed on success. Judge by the exit code, not by errors. [version] does not read prerelease or build suffixes (a pnpm pin carries sha512) and wants two numbers at least; strip and pad first. The MSI goes into a per-run directory under %TEMP% instead of its predictable name next to everything else, is required to carry the OpenJS Foundation signature (the SHASUMS hash comes from the same host), and msiexec.exe is resolved from System32, not PATH.
…C up to date Double-clicking now changes nothing: it reports what is out of date (Node of the .nvmrc major, npm, pinned pnpm, a clean main's distance behind origin, the installed mpv helper) with the exact command for each. Only -Apply installs, pulls or reinstalls, and -DryRun stays as an old name for the check. The Node installer is staged under a per-run %ProgramData%\FastStream directory locked by ACL to this user, Administrators and SYSTEM, so the same-user race between the hash check and the elevated msiexec the review flagged is closed.
Owner
Author
|
Both threads addressed in 82266ef:
Behavior change worth noting: the default (double-click) run is now check-and-report only — it names what is out of date and the exact commands, and changes nothing. |
2 tasks
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.
Third part of making issue #10 closable. GitHub can't update your PC, so
update-local.cmd, a double-click in the repository's root, does. It runstools/update-local.ps1, which brings your PC to what CI uses. It follows CI's rule: a release counts once it is 5 days old..nvmrcnames, from nodejs.org's installer, checked against itsSHASUMS256.txt. Windows asks for admin rights. A newer major you already have is kept%APPDATA%\npmpackage.jsonpins. Inside the repository, pnpm switches to that version by itselfmainwith nothing uncommitted:git pull --ff-only, thenpnpm install --frozen-lockfileinto the storenode_modulesalready uses (V:\.pnpm-store), and fsaunpack'snpm ciwith scripts offnative-host/install.ps1again when the repository's host file differs from the installed one, keeping your mpv and Node pathsIt never touches:
C:\Program Files\mpvis your own repository,Nawid3333/mpv, with its own updater. It's already on the build CI pins.pnpm run verify:linuxupdates its distros.Options and failures:
-DryRunonly says what it would do.-Repo <path>points it at another checkout.Tested on this PC for real, against the main checkout:
6018d621(release 1.3.82.51);V:\.pnpm-store, and ran fsaunpack'snpm ci;.bat:{"ok":true,"mpv":true,"path":"C:\\Program Files\\mpv\\mpv.exe"}.Node, npm and pnpm were already current, so no admin prompt came up. After #119 merges,
.nvmrcsays 26 and the script would install 26.10.0 once it's 5 days old.Tests:
tests/unit/updateLocal.test.mjscovers the version picks (age rule, fallback to the previous major, prereleases and deprecated releases skipped). It also checks that the script is ASCII, which Windows PowerShell 5.1 needs for a file without a BOM, and that it parses in Windows PowerShell..gitattributesgives.cmdfiles CRLF line endings. Lint, typecheck and the unit tests (942) pass.Docs: a "Your PC" section in
docs/maintenance.md, andCLAUDE.md's Commands section.Ships nothing.
🤖 Generated with Claude Code