Skip to content

Commit 482a8bc

Browse files
Bi0T1Narturcic
authored andcommitted
Move usage examples into docs section
1 parent bafb3a6 commit 482a8bc

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

docs/input/docs/usage/cli/output.md

+14
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,17 @@ For that you have to run `GitVersion.exe /output dotenv` and store the output
2121
into e.g. a `gitversion.env` file. These files can also be passed around in CI environments
2222
like [GitHub](https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#passing-values-between-steps-and-jobs-in-a-workflow)
2323
or [GitLab](https://docs.gitlab.com/ee/ci/variables/#pass-an-environment-variable-to-another-job).
24+
Below are some examples of using the Dotenv format in the Unix command line:
25+
```bash
26+
# Output version variables in Dotenv format
27+
gitversion /output dotenv
28+
29+
# Show only a subset of the version variables in Dotenv format
30+
gitversion /output dotenv | grep -i "prerelease"
31+
32+
# Show only a subset of the version variables that match the regex in Dotenv format
33+
gitversion /output dotenv | grep -iE "major|sha=|_prerelease"
34+
35+
# Write version variables in Dotenv format into a file
36+
gitversion /output dotenv > gitversion.env
37+
```

new-cli/command.md

-12
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,6 @@ cat gitversion.json | gitversion output buildserver
5353
# Read version variables from stdin and write to Jenkins.
5454
cat gitversion.json | gitversion output buildserver --buildserver Jenkins
5555

56-
# Output version variables in Dotenv format
57-
gitversion /output dotenv
58-
59-
# Show only a subset of the version variables in Dotenv format (Unix syntax)
60-
gitversion /output dotenv | grep -i "prerelease"
61-
62-
# Show only a subset of the version variables that match the regex in Dotenv format (Unix syntax)
63-
gitversion /output dotenv | grep -iE "major|sha=|_prerelease"
64-
65-
# Write version variables in Dotenv format into a file
66-
gitversion /output dotenv > gitversion.env
67-
6856
# Read version variables from stdin and write to globbed .wxi files.
6957
cat gitversion.json | gitversion output wix --path ./**/*.wxi
7058

0 commit comments

Comments
 (0)