Skip to content

Commit f32c9c8

Browse files
authored
Merge pull request #1186 from asbjornu/feature/homebrew-doc
Added Homebrew documentation
2 parents f2b6dea + 4cf52f4 commit f32c9c8

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

docs/usage/command-line.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
11
# Command Line
22

3-
If you want a command line version installed on your machine then you can use [Chocolatey](http://chocolatey.org) to install GitVersion
3+
If you want a command line version installed on your machine then you can use [Chocolatey](http://chocolatey.org) or [Homebrew](https://brew.sh/) to install GitVersion.
44

5-
Available on [Chocolatey](http://chocolatey.org) under [GitVersion.Portable](http://chocolatey.org/packages/GitVersion.Portable)
5+
## Chocolatey
66

7-
> choco install GitVersion.Portable
7+
Available on [Chocolatey](http://chocolatey.org) under [GitVersion.Portable](http://chocolatey.org/packages/GitVersion.Portable).
8+
9+
```shell
10+
choco install GitVersion.Portable
11+
```
812

913
Switches are available with `GitVersion /?`
1014

15+
## Homebrew
16+
17+
To install GitVersion with [Homebrew](https://brew.sh/), type:
18+
19+
```shell
20+
brew install gitversion
21+
```
22+
23+
Switches are available with `gitversion --help`. Even though the documentation uses a slash `/` for all switches, you need to use a dash `-` instead, since `/` is interpreted as a root path on POSIX based operating systems.
24+
1125
## Output
1226

1327
By default GitVersion returns a json object to stdout containing all the [variables](../more-info/variables.md) which GitVersion generates. This works great if you want to get your build scripts to parse the json object then use the variables, but there is a simpler way.
1428

1529
`GitVersion.exe /output buildserver` will change the mode of GitVersion to write out the variables to whatever build server it is running in. You can then use those variables in your build scripts or run different tools to create versioned NuGet packages or whatever you would like to do. See [build servers](../build-server-support/build-server-support.md) for more information about this.
1630

1731
## Inject version metadata into the assembly
18-
`GitVersion.exe /updateassemblyinfo` will recursively search for all `AssemblyInfo.cs` or `AssemblyInfo.vb` files in the git repo and update them.
32+
`GitVersion.exe /updateassemblyinfo` will recursively search for all `AssemblyInfo.cs` or `AssemblyInfo.vb` files in the git repo and update them.
1933
It will update the following assembly attributes:
2034

2135
* `AssemblyVersion` will be set to the `AssemblySemVer` variable.
@@ -24,15 +38,15 @@ It will update the following assembly attributes:
2438

2539
Note that contrary to when using the [MSBuild Task](msbuild-task.md) the attributes must already exist in the `AssemblyInfo.cs` or `AssemblyInfo.vb` files prior to calling GitVersion.
2640

27-
By adding `/updateassemblyinfo <filenames>` the name of AssemblyInfo file to update can be set. This switch can accept multiple files with the path to the file specified relative to the working directory.
41+
By adding `/updateassemblyinfo <filenames>` the name of AssemblyInfo file to update can be set. This switch can accept multiple files with the path to the file specified relative to the working directory.
2842

2943
GitVersion can generate an assembly info source file for you if it does not already exist. Use the `/ensureassemblyinfo` switch alongside `/updateassemblyinfo <filename>`, if the filename specified does not exist it will be generated based on a known template that adds:
3044

3145
* `AssemblyVersion` will be set to the `AssemblySemVer` variable.
3246
* `AssemblyFileVersion` will be set to the `MajorMinorPatch` variable with a appended `.0`.
3347
* `AssemblyInformationalVersion` will be set to the `InformationalVersion` variable.
3448

35-
This can be done for *.cs, *.vb and *.fs files.
49+
This can be done for *.cs, *.vb and *.fs files.
3650

3751
When requesting that GitVersion generate an assembly info file you are limited to only specifying a single `<filename>` within the `/updateassemblyinfo` switch, this is to prevent the creation of mulitple assembly info files with the same assembly version attributes. If this occurs your build will fail.
3852

@@ -57,7 +71,7 @@ Will result in command line argument error
5771
Will iterate through each file and update known attributes (`AssemblyVersion`, `AssemblyFileVersion`, `AssemblyInformationalVersion`).
5872

5973
## Override config
60-
`/overrideconfig [key=value]` will override appropriate key from 'GitVersion.yml'.
74+
`/overrideconfig [key=value]` will override appropriate key from 'GitVersion.yml'.
6175

6276
At the moment only `tag-prefix` option is supported. Read more about [Configuration](/configuration/).
6377

@@ -67,4 +81,4 @@ It will not change config file 'GitVersion.yml'.
6781
`GitVersion.exe /output json /overrideconfig tag-prefix=custom`
6882

6983
## Mono
70-
To use on mac or linux, install `mono-complete` then just run `mono GitVersion.exe`
84+
To use on mac or linux, install `mono-complete` then just run `mono GitVersion.exe`

0 commit comments

Comments
 (0)