C2: lutra CLI in the setup with optional PATH entry, xtask bundle prints the version
Some checks failed
ci / ci (macos-15) (push) Has been cancelled
ci / ci (ubuntu-24.04) (push) Has been cancelled
ci / ci (windows-2025) (push) Has been cancelled

- xtask bundle builds lutra-cli and adds it as a Tauri external binary
  through a --config override (lutra.exe next to the app on Windows,
  Lutra.app/Contents/MacOS/lutra on macOS); prints path, version, size.
- NSIS: "Add lutra to PATH" page, unticked by default, /ADDTOPATH for
  silent installs. Changes HKCU\Environment Path only, keeps its type,
  broadcasts WM_SETTINGCHANGE, records the entry; the uninstaller removes
  exactly that entry. A PATH too long for NSIS strings is left alone.
- lutra CLI resolves a symlinked executable before looking for the app.
- localStorage: the UI never used webview storage, so there is nothing to
  migrate; docs corrected, ESLint now bans localStorage, sessionStorage
  and indexedDB, with tests.
- docs/install.md: CLI, PATH, macOS link step, webview folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-01 12:46:49 +01:00
parent d8e66a4652
commit 0a4b80adec
7 changed files with 628 additions and 46 deletions

View file

@ -394,6 +394,9 @@ FunctionEnd
!define MUI_PAGE_CUSTOMFUNCTION_PRE SkipIfPassive
!insertmacro MUI_PAGE_DIRECTORY
; Lutra: the "Add lutra to PATH" page (`LUTRA_PATH_PAGE` in `hooks.nsh`).
!insertmacro LUTRA_PATH_PAGE
; 6. Start menu shortcut page
Var AppStartMenuFolder
!if "${STARTMENUFOLDER}" != ""
@ -488,6 +491,26 @@ FunctionEnd
!include "{{this}}"
{{/each}}
; Lutra: the texts of the "Add lutra to PATH" page and its log lines. They
; live here, not in `hooks.nsh`, because the bundler writes this file as
; UTF-8 with a byte order mark, which the German umlauts need.
LangString lutraPathTitle ${LANG_ENGLISH} "Command line"
LangString lutraPathSubtitle ${LANG_ENGLISH} "Use Lutra from a terminal."
LangString lutraPathText ${LANG_ENGLISH} "Setup installs the lutra command next to Lutra, so that lutra file.php opens the file in Lutra. To run it as lutra in every new terminal, add the install folder to your PATH.$\r$\n$\r$\nThis changes the PATH of your user account only. The uninstaller removes the entry again."
LangString lutraPathCheckbox ${LANG_ENGLISH} "Add lutra to PATH"
LangString lutraPathAdded ${LANG_ENGLISH} "Added $INSTDIR to the user PATH."
LangString lutraPathRemoved ${LANG_ENGLISH} "Removed Lutra's entry from the user PATH."
LangString lutraPathFailed ${LANG_ENGLISH} "Cannot change the user PATH: it cannot be read or is too long. Add $INSTDIR to it by hand to use lutra in a terminal."
!ifdef LANG_GERMAN
LangString lutraPathTitle ${LANG_GERMAN} "Kommandozeile"
LangString lutraPathSubtitle ${LANG_GERMAN} "Lutra aus einem Terminal verwenden."
LangString lutraPathText ${LANG_GERMAN} "Das Setup installiert den Befehl lutra neben Lutra, damit lutra datei.php die Datei in Lutra öffnet. Damit er in jedem neuen Terminal als lutra läuft, fügen Sie den Installationsordner zu Ihrem PATH hinzu.$\r$\n$\r$\nDas ändert nur den PATH Ihres Benutzerkontos. Die Deinstallation entfernt den Eintrag wieder."
LangString lutraPathCheckbox ${LANG_GERMAN} "lutra zum PATH hinzufügen"
LangString lutraPathAdded ${LANG_GERMAN} "$INSTDIR zum Benutzer-PATH hinzugefügt."
LangString lutraPathRemoved ${LANG_GERMAN} "Lutras Eintrag aus dem Benutzer-PATH entfernt."
LangString lutraPathFailed ${LANG_GERMAN} "Der Benutzer-PATH kann nicht geändert werden: Er ist nicht lesbar oder zu lang. Fügen Sie $INSTDIR von Hand hinzu, um lutra im Terminal zu verwenden."
!endif
Function .onInit
${GetOptions} $CMDLINE "/P" $PassiveMode
${IfNot} ${Errors}
@ -561,6 +584,9 @@ Function .onInit
${EndIf}
${EndIf}
!endif
; Lutra: the initial "Add lutra to PATH" choice (`hooks.nsh`).
!insertmacro LUTRA_PATH_INIT
FunctionEnd
Section WebView2