Skip to content

Commit 9495328

Browse files
committed
Add 'go install' support
1 parent 3fed441 commit 9495328

7 files changed

Lines changed: 28 additions & 6 deletions

File tree

.github/workflows/deploy_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v6
2222
with:
23-
cache-dependency-path: mshell/go.sum
24-
go-version-file: 'mshell/go.mod'
23+
cache-dependency-path: go.sum
24+
go-version-file: 'go.mod'
2525

2626
- name: Setup SSH
2727
run: |

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v6
1919
with:
20-
cache-dependency-path: mshell/go.sum
21-
go-version-file: 'mshell/go.mod'
20+
cache-dependency-path: go.sum
21+
go-version-file: 'go.mod'
2222

2323
- name: Build go with all different os and arch
2424
run: cd mshell && go build -o mshell

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v6
2222
with:
23-
cache-dependency-path: mshell/go.sum
24-
go-version-file: 'mshell/go.mod'
23+
cache-dependency-path: go.sum
24+
go-version-file: 'go.mod'
2525

2626
- name: Build go
2727
run: cd mshell && go build -o mshell && cp mshell msh

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- The CLI can now be installed with the Go toolchain:
13+
`go install github.com/mitchpaulus/mshell/mshell@latest`.
14+
This only installs the binary;
15+
the standard library still needs to be set up separately.
16+
1217
- Optional `followRedirects` key (bool, default `true`) on the `httpGet` /
1318
`httpPost` request dictionary. Set it to `false` to get the first response
1419
back as-is instead of following redirects, e.g. to inspect the `Location` or

doc/getting-started.inc.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ <h3 id="getting-started-installation-windows">Windows</h3>
3535
Move-Item msh.exe <span class="mshellSTRING">"$env:USERPROFILE\\bin\\"</span></code>
3636
</pre>
3737

38+
<h3 id="getting-started-installation-go">Alternative: <code>go install</code></h3>
39+
40+
<p>
41+
If you have a Go toolchain (1.25 or later), you can build and install the binary directly:
42+
</p>
43+
44+
<pre>
45+
<code>go install github.com/mitchpaulus/mshell/mshell@latest</code>
46+
</pre>
47+
48+
<p>
49+
Note that <code>@latest</code> installs the tip of the <code>main</code> branch.
50+
To pin a released version, use the tag, e.g. <code>@v0.14.0</code> (works for releases after v0.13.0).
51+
The installed binary is named <code>mshell</code>; rename it or symlink it to <code>msh</code> if you prefer the short name.
52+
<code>go install</code> only installs the binary, so you still need to set up the standard library as described below.
53+
</p>
54+
3855
<h2 id="getting-started-installation-stdlib">2) Set up the standard library</h2>
3956

4057
<p>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)