-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d0e7373
commit 07a5a1c
Showing
4 changed files
with
26 additions
and
2 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import subprocess | ||
|
||
revision = ( | ||
subprocess.check_output(["git", "rev-parse", "HEAD"]) | ||
.strip() | ||
.decode("utf-8")[:7] | ||
) | ||
|
||
def modify_system_task_h(): | ||
result = "" | ||
with open("./src/system_task.h", 'r') as file: | ||
for line in file: | ||
if "String firmware_ =" in line: | ||
result += f" String firmware_ = \"{revision}\";\n" | ||
else: | ||
result += line | ||
|
||
with open("./src/system_task.h", 'w') as output: | ||
output.write(result) | ||
|
||
|
||
modify_system_task_h() |
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