File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55identifier string. It retrieves the VCS identifier from the 'vcs_utils' module
66and writes it to a specified source file.
77
8- The script will overwrite the file if it already exists, and any write failures
9- are handled gracefully.
10-
118This script should be loaded by PlatformIO during the project build and is not
129designed to be run independently.
1310"""
Original file line number Diff line number Diff line change 22vcs_utils.py
33
44This module provides utility functions to retrieve the version control system
5- (VCS) identifier using Git and to write it to a C source file.
5+ (VCS) identifier using Git and to write it to a file.
66
77The functions handle cases where Git is not installed or the current directory
88is not a Git repository, and handle file write failures gracefully.
@@ -43,11 +43,11 @@ def get_vcs_id():
4343
4444def write_vcs_id_to_file (vcs_id , file_path ):
4545 """
46- Writes the given VCS identifier as a C-style string to a file.
46+ Defines a macro with the given VCS identifier as a string literal to a file.
4747
4848 Args:
4949 vcs_id (str): The VCS identifier string to write to the file.
50- file_path (str): The path to the C source file to write to.
50+ file_path (str): The path to the file to write to.
5151
5252 If the file exists, it will be overwritten. If writing to the file fails,
5353 a warning will be printed to stderr, but the script will not terminate
You can’t perform that action at this time.
0 commit comments