File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -358,6 +358,8 @@ This change ensures that VSCode uses the "Ninja Multi-Config" generator by defau
358358## [ Software versioning] ( # )
359359 * [ Semantic Versioning] ( docs/semantic_versioning.md )
360360 * [ Getting Version From Git in CMake] ( docs/getting_version_from_git_in_CMake.md )
361+ * [ Getting Release Version From Git (check for update)] ( docs/get_the_release_version_github.md )
362+
361363
362364## [ C++ Coding Standards and Style Guide] ( # )
363365 * [ Goolge C++ Style Guide] ( https://google.github.io/styleguide/cppguide.html )
Original file line number Diff line number Diff line change 1+ To get the latest release version of a GitHub repository using ` curl ` , you can query the GitHub API. Here's how you can do it:
2+
3+ 1 . Open a terminal or command prompt.
4+ 2 . Run the following ` curl ` command, replacing ` owner ` with the repository owner's name and ` repo ` with the repository's name:
5+
6+ ``` bash
7+ curl --silent " https://api.github.com/repos/owner/repo/releases/latest" | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/'
8+ ```
9+
10+ ### Explanation:
11+ - ` https://api.github.com/repos/owner/repo/releases/latest ` : This is the GitHub API endpoint for getting the latest release of a repository.
12+ - ` grep '"tag_name":' ` : Filters the response to show only the line that contains the release tag.
13+ - ` sed -E 's/.*"([^"]+)".*/\1/' ` : Extracts the version tag (the part inside double quotes after ` "tag_name": ` ).
14+
15+ ### Example:
16+ If you want to get the latest release of the repository ` behnamasadi/cpp_tutorials ` , you would run:
17+
18+ ``` bash
19+ curl --silent " https://api.github.com/repos/behnamasadi/cpp_tutorials/releases/latest" | grep ' "tag_name":' | sed -E ' s/.*"([^"]+)".*/\1/'
20+ ```
21+
22+ for instance:
23+
24+ ```
25+ curl --silent "https://api.github.com/repos/nerfstudio-project/gsplat/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
26+ ```
27+
28+
You can’t perform that action at this time.
0 commit comments