Skip to content

Commit

Permalink
Other fixes
Browse files Browse the repository at this point in the history
Add special Python command for Windows, specify HEAD for git shortlog
(why did it work?)
  • Loading branch information
Silvia González Rodríguez committed Jan 31, 2025
1 parent 33545a2 commit 48c36be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions resources/text/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ add_custom_target(
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/text.qrc
)

if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
set(PYTHON_COMMAND python3)
else()
set(PYTHON_COMMAND python.exe)
endif()

execute_process(
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/get_contributors.py
COMMAND ${PYTHON_COMMAND} ${CMAKE_CURRENT_SOURCE_DIR}/get_contributors.py
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
#COMMAND_ERROR_IS_FATAL ANY
#COMMAND_ERROR_IS_FATAL ANY
)
4 changes: 2 additions & 2 deletions resources/text/get_contributors.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import subprocess

git_output = subprocess.run(
["git", "shortlog", "-sn", "--no-merges"], capture_output=True, text=True
["git", "shortlog", "HEAD", "-sn", "--no-merges"], capture_output=True, text=True
)
lines = git_output.stdout.splitlines()
names = [line.partition("\t")[-1] for line in lines]

text = ""
for name in names:
text = text + "<p align=\"center\" style=\"margin: 0\">" + name + "</p>\n"
text = text + '<p align="center" style="margin: 0">' + name + "</p>\n"

file = open("gen_contributors.html", "w")
file.write(text)
Expand Down

0 comments on commit 48c36be

Please sign in to comment.