Skip to content

Commit

Permalink
Convert contributors list script to Python
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvia González Rodríguez committed Jan 31, 2025
1 parent 05f8963 commit 1552f3e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion resources/text/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_custom_target(
)

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

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

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

file = open("gen_contributors.html", "w")
file.write(text)
file.close()
10 changes: 0 additions & 10 deletions resources/text/get_contributors.sh

This file was deleted.

0 comments on commit 1552f3e

Please sign in to comment.