Skip to content

docs: add windows startup scripts and document#34

Open
sivdead wants to merge 1 commit intodtyq:legacyfrom
sivdead:master
Open

docs: add windows startup scripts and document#34
sivdead wants to merge 1 commit intodtyq:legacyfrom
sivdead:master

Conversation

@sivdead
Copy link
Copy Markdown

@sivdead sivdead commented Jun 1, 2025

No description provided.

douyun-dtyq pushed a commit that referenced this pull request Mar 25, 2026
Copy link
Copy Markdown

@JiwaniZakir JiwaniZakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@JiwaniZakir JiwaniZakir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants