f
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
## Problem on "Other Computer"
|
||||
|
||||
When running `bootstrap.py` on another machine, the installation completes successfully with messages about creating `mm.ps1` and `mm.bat`, but the `mm` command is not recognized when executed.
|
||||
When running `bootstrap.py` on another machine, the installation completes successfully with messages about creating `mm.bat`, but the `mm` command is not recognized when executed.
|
||||
|
||||
**Root Cause:** Windows terminal sessions cache the PATH environment variable. When registry changes are made, existing terminal sessions don't automatically reload the new PATH. The shim files are created correctly, but they're not discoverable until PATH is reloaded.
|
||||
**Root Cause:** Windows terminal sessions cache the PATH environment variable. When registry changes are made, existing terminal sessions don't automatically reload the new PATH. The batch shim is created correctly, but it isn't discoverable until either the current session reloads PATH or a new terminal is opened.
|
||||
|
||||
## Solution
|
||||
|
||||
@@ -25,13 +25,7 @@ $env:PATH = [Environment]::GetEnvironmentVariable('PATH', 'User') + ';' + [Envir
|
||||
mm --help
|
||||
```
|
||||
|
||||
Note: The bootstrap installation automatically attempts this, but it may not work if PowerShell was launched with a restricted execution policy.
|
||||
|
||||
### Option 3: Manual PATH Reload (PowerShell)
|
||||
```powershell
|
||||
$env:Path = [Environment]::GetEnvironmentVariable('PATH', 'User') + ';' + [Environment]::GetEnvironmentVariable('PATH', 'Machine')
|
||||
mm --help
|
||||
```
|
||||
Note: The bootstrap installation already attempts a reload for you, but it only affects new commands started after the update (or terminals that already inherit the updated PATH).
|
||||
|
||||
## Diagnostic Command
|
||||
|
||||
@@ -42,8 +36,8 @@ python scripts/bootstrap.py --check-install
|
||||
```
|
||||
|
||||
This will check:
|
||||
- ✓ Shim files exist (`mm.ps1` and `mm.bat`)
|
||||
- ✓ Shim files have valid content
|
||||
- ✓ Batch shim exists (`mm.bat`)
|
||||
- ✓ Shim content is valid and points at the local venv
|
||||
- ✓ PATH environment variable is configured
|
||||
- ✓ Registry PATH was updated
|
||||
- ✓ Test if `mm` command is accessible
|
||||
@@ -54,26 +48,25 @@ This will check:
|
||||
Checking 'mm' command installation...
|
||||
|
||||
Checking for shim files:
|
||||
mm.ps1: ✓ (C:\Users\Admin\bin\mm.ps1)
|
||||
mm.bat: ✓ (C:\Users\Admin\bin\mm.bat)
|
||||
mm.bat: ✓ (C:\Users\Admin\bin\mm.bat)
|
||||
|
||||
Checking PATH environment variable:
|
||||
C:\Users\Admin\bin in current session PATH: ✓
|
||||
C:\Users\Admin\bin in registry PATH: ✓
|
||||
C:\Users\Admin\bin in current session PATH: ✗
|
||||
C:\Users\Admin\bin in registry PATH: ✗
|
||||
|
||||
Testing 'mm' command...
|
||||
✗ 'mm' command not found in PATH
|
||||
Shims exist but command is not accessible via PATH
|
||||
✗ 'mm' command not found in PATH
|
||||
Shims exist but command is not accessible via PATH
|
||||
|
||||
Attempting to call shim directly...
|
||||
✓ Direct shim call works!
|
||||
The shim files are valid and functional.
|
||||
✓ Direct shim call works!
|
||||
The shim files are valid and functional.
|
||||
|
||||
⚠️ 'mm' is not in PATH, but the shims are working correctly.
|
||||
⚠️ 'mm' is not in PATH, but the shim is working correctly.
|
||||
Possible causes and fixes:
|
||||
1. Terminal needs restart: Close and reopen your terminal/PowerShell
|
||||
2. PATH reload: Run: . scripts\reload-path.ps1
|
||||
3. Manual PATH: Add C:\Users\Admin\bin to your system PATH manually
|
||||
1. Terminal needs restart: Close and reopen your terminal/PowerShell
|
||||
2. PATH reload: Run: $env:Path = [Environment]::GetEnvironmentVariable('PATH', 'User') + ';' + [Environment]::GetEnvironmentVariable('PATH', 'Machine')
|
||||
3. Manual PATH: Add C:\Users\Admin\bin to your system PATH manually
|
||||
```
|
||||
|
||||
If the diagnostic shows:
|
||||
@@ -118,13 +111,11 @@ This shows:
|
||||
|
||||
## Shim File Locations
|
||||
|
||||
The installation creates Windows shim files in:
|
||||
The installation creates a Windows shim in:
|
||||
- **User bin directory:** `C:\Users\<YourUsername>\bin\`
|
||||
- **Files created:**
|
||||
- `mm.ps1` - PowerShell shim
|
||||
- `mm.bat` - Command Prompt shim
|
||||
- **File created:** `mm.bat` – a batch shim that both CMD and PowerShell can execute without changing the system execution policy.
|
||||
|
||||
These files contain the absolute path to your project and venv, so they work from any location.
|
||||
The batch shim contains the absolute path to your project and venv, so it always runs the local CLI regardless of the current directory.
|
||||
|
||||
## Why This Happens
|
||||
|
||||
|
||||
Reference in New Issue
Block a user