docs: add windows startup scripts and document#34
docs: add windows startup scripts and document#34sivdead wants to merge 1 commit intodtyq:legacyfrom
Conversation
…ic:fix/fix-bootstrap-init-03-25 into master
JiwaniZakir
left a comment
There was a problem hiding this comment.
In bin/magic.ps1, the $SKIP_INSTALLATION block around line 160–165 contains dead code: both branches of the if (Test-Path ".env_super_magic") condition assign $env:MAGIC_USE_SUPER_MAGIC = "", making the conditional pointless — it appears the intent was to mirror the lock-file logic above where use_super_magic sets the profile flags.
The Check-SandboxNetwork function splits on = using ($networkLine -split "=")[1], which will silently truncate or break values that contain = characters (e.g., base64-encoded secrets or URLs with query strings). Using -split "=", 2 with a limit of 2 would be more robust.
The Bilingual function references $script:USER_LANG before that variable is guaranteed to be initialized — for instance, Check-SuperMagicEnv calls Bilingual but can be reached in code paths where $script:USER_LANG hasn't been set yet (e.g., if $SKIP_LANGUAGE_SELECTION is false and Choose-Language hasn't run). Adding a fallback like if (-not $script:USER_LANG) { $script:USER_LANG = $SYSTEM_LANG } at the top of Bilingual would prevent silent empty-string comparisons from defaulting unexpectedly to the English branch.
JiwaniZakir
left a comment
There was a problem hiding this comment.
In bin/magic.ps1, the $SKIP_INSTALLATION block contains a redundant conditional that sets $env:MAGIC_USE_SUPER_MAGIC = "" in both branches regardless of whether .env_super_magic exists — this is almost a copy-paste bug where the if branch should have assigned a non-empty profile string (matching the analogous logic in the lock-file check block above it, which sets " --profile magic-gateway --profile sandbox-gateway"). Additionally, the Bilingual function references $script:USER_LANG but Check-SuperMagicEnv (which calls Bilingual) is defined before $script:USER_LANG is ever assigned, meaning any early invocation of that function would silently fall through to the English branch rather than erroring — worth adding a guard or defaulting $script:USER_LANG at the top of the script. The README updates in README_CN.md are clear and well-structured, though it would be worth noting whether magic.ps1 requires a minimum PowerShell version (e.g., 5.1 vs. 7+), since Get-Culture behavior and certain string operators differ across versions.
No description provided.