Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(man): Add correct date and version to manpage
The previous approach relied on manually updating the version and date using a Makefile This approach dynamically gathers the correct version from git and uses the date of the latest commit in the branch
- Loading branch information
1 parent
669469f
commit 6f88fe1
Showing
4 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/build* | ||
/doc/config | ||
/include/settings.hpp | ||
/man/polybar.1 | ||
/polybar | ||
/polybar-msg | ||
/tags | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
# Gets the date of the latest commit in the form YYYY-MM-DD | ||
# This date is used in the man page | ||
execute_process(COMMAND git log -1 --date=format:%Y-%m-%d --format=%cd | ||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} | ||
OUTPUT_VARIABLE LAST_COMMIT_DATE | ||
OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
|
||
set(MAN_PAGES_1 polybar.1) | ||
configure_file( | ||
${CMAKE_CURRENT_LIST_DIR}/${MAN_PAGES_1}.cmake | ||
${CMAKE_CURRENT_LIST_DIR}/${MAN_PAGES_1} | ||
ESCAPE_QUOTES @ONLY) | ||
|
||
INSTALL(FILES ${MAN_PAGES_1} | ||
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1 | ||
COMPONENT doc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters