@cryptotaxi247 / kubo / commits / 562365f4f

Adding PowerShell to Minimal Go Installation

Separated CMD and PowerShell to add additional support.

chblodg committed Dec 17, 2021 at 09:51 UTC 562365f4fccda80f6a4e08eaee4b534c1f2e3b98
1 file changed +18 -2
docs/windows.md
+18 -2
@@ -114,20 +114,36 @@ You can use whichever version of `git` you wish but we recommend the Windows bui
114
115 Clone and change directory to the source code, if you haven't already:
116
117 -```
117 +CMD:
118 +```bat
119 git clone https://github.com/ipfs/go-ipfs %GOPATH%/src/github.com/ipfs/go-ipfs
120 cd %GOPATH%/src/github.com/ipfs/go-ipfs/cmd/ipfs
121 ```
122
123 +PowerShell:
124 +```powershell
125 +git clone https://github.com/ipfs/go-ipfs $env:GOPATH/src/github.com/ipfs/go-ipfs
126 +cd $env:GOPATH/src/github.com/ipfs/go-ipfs/cmd/ipfs
127 +```
128 +
129 We need the `git` commit hash to be included in our build so that in the extremely rare event a bug is found, we have a reference point later for tracking it. We'll ask `git` for it and store it in a variable. The syntax for the next command is different depending on whether you're using the interactive command line or writing a batch file. Use the one that applies to you.
130 - interactive: `FOR /F %V IN ('git rev-parse --short HEAD') do set SHA=%V`
131 - interpreter: `FOR /F %%V IN ('git rev-parse --short HEAD') do set SHA=%%V`
132
133 Finally, we'll build and test `ipfs` itself.
127 -```
134 +
135 +CMD:
136 +```bat
137 go install -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=%SHA%"
138 %GOPATH%\bin\ipfs.exe version --all
139 ```
140 +
141 +PowerShell:
142 +```powershell
143 +go install -ldflags="-X "github.com/ipfs/go-ipfs".CurrentCommit=$env:SHA"
144 +cp ./ipfs.exe $env:GOPATH/bin/ipfs.exe -force
145 +. $env:GOPATH/bin/ipfs.exe version --all
146 +```
147 You can check that the ipfs output versions match with `go version` and `git rev-parse --short HEAD`.
148 If `ipfs.exe` executes and everything matches, then building was successful.
149