From 5e1432ff6b6f4ed21750a4496f6b1cd422839db0 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Fri, 18 Feb 2022 10:34:44 +0100 Subject: [PATCH] Mention some PowerShell specific issues (#1675) * Mention Git for Windows as alternative * Mention powershell path issue --- docs/windows.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/windows.md b/docs/windows.md index f123860b3..572ae515a 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -28,6 +28,11 @@ After installation completes, run msys2, and run the following command: $ pacman -S git ``` +If you have native Windows apps relying on Git, e.g. the PowerShell extension +[posh-git](https://github.com/dahlbyk/posh-git), you may want to install +[Git for Windows](https://gitforwindows.org/) and put it on the path instead, +as msys Git may cause issues with them. + **Bazel**: Use Start>Run to open PowerShell. Create a folder to store Bazel @@ -86,3 +91,19 @@ When you run a script like .\run, MSYS and bazel will automatically be added to the path, and Bazel will be configured to output build products into \bazel\anki. If you want to directly invoke bazel before having run any of the .bat files in this repo, please run tools\setup-env first. + +However, this will not work in PowerShell, as .bat files are executed in a subprocess. +To invoke bazel scripts, you will have to adjust your session path manually. +One option is to create a script that sets up your Anki develop environment for you. +Here is an example: + +```powershell +# put bazel and msys on path +$env:PATH = "c:\bazel;c:\msys64\usr\bin;$env:PATH" +# change working directory to anki root +Set-Location C:\code\anki +# open VSC +code . +# open powershell 7 +pwsh +```